Created
January 23, 2019 11:28
-
-
Save defilerc/e167bb0760dd17308de57703db314f9f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$smo = 'Microsoft.SqlServer.Management.Smo.' | |
$wmi = new-object ($smo + 'Wmi.ManagedComputer'). | |
# List the object properties, including the instance names. | |
$Wmi | |
# Enable the TCP protocol on the default instance. | |
$uri = "ManagedComputer[@Name='NT-44']/ ServerInstance[@Name='SQLEXPRESS']/ServerProtocol[@Name='Tcp']" | |
$Tcp = $wmi.GetSmoObject($uri) | |
$Tcp.IsEnabled = $true | |
$Tcp.Alter() | |
$Tcp | |
# Enable the named pipes protocol for the default instance. | |
$uri = "ManagedComputer[@Name='NT-44']/ ServerInstance[@Name='SQLEXPRESS']/ServerProtocol[@Name='Np']" | |
$Np = $wmi.GetSmoObject($uri) | |
$Np.IsEnabled = $true | |
$Np.Alter() | |
$Np |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment