Sqlserver
 sql >> Base de Dados >  >> RDS >> Sqlserver

Como configurar o SQL Native Client com o powershell?

[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement")
$wmi = new-object ("Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer") "$env:computername"
$wmi.ServerInstances["SQLEXPRESS"].ServerProtocols["Tcp"].IsEnabled = $true
$wmi.ServerInstances["SQLEXPRESS"].ServerProtocols["Np"].IsEnabled = $true
$wmi.ClientProtocols["tcp"].IsEnabled = $true
$wmi.ClientProtocols["np"].IsEnabled = $true