Created
August 25, 2015 20:02
-
-
Save stefanteixeira/12208058dd0894ce0873 to your computer and use it in GitHub Desktop.
PowerShell script to enable TCP in SQL Server
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
Import-Module "sqlps" | |
$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='" + (get-item env:\computername).Value + "']/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol[@Name='Tcp']" | |
$Tcp = $wmi.GetSmoObject($uri) | |
$Tcp.IsEnabled = $true | |
$Tcp.Alter() | |
$Tcp |
Sorry @geradev, it's been more than 5 years I don't work with that, didn't even worked with Windows since then 😕
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just sharing, the sql server express container image does the same thing but with registry keys. From the DockerFile