This script returns the status of the TCP protocol settings and changes the status to enabled
set wmi = GetObject("WINMGMTS:\\.\root\Microsoft\SqlServer\ComputerManagement")
for each prop in wmi.ExecQuery("select * " & _
"from ServerNetworkProtocol " & _
"where InstanceName = 'sqltools'")
WScript.Echo prop.ProtocolName & " - " & _
prop.ProtocolDisplayName & " " & _
prop.Enabled
next
' enable tcpip
for each changeprop in wmi.ExecQuery("select * " & _
"from ServerNetworkProtocol " & _
"where InstanceName = 'sqltools' and " & _
"ProtocolName = 'Tcp'")
changeprop.SetEnable()
next
No comments:
Post a Comment
Note: only a member of this blog may post a comment.