Re: enable TCPIP Protocols by script
- From: "Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@xxxxxxxxxx>
- Date: Tue, 30 Jan 2007 15:06:33 +0100
BTW, you have to restart the service if you want changes in network
protocols to take effect.
--
Dejan Sarka
http://www.solidqualitylearning.com/blogs/
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@xxxxxxxxxx> wrote in
message news:eRGorcHRHHA.412@xxxxxxxxxxxxxxxxxxxxxxx
How do you enable TCPIP in Protocols for Network Config for the sql
server
2005 and for all the specific IP addressses via T-SQL script.
I do not know for T-SQL, but I guess you can do it with SMO or WMI. Here
is a VBScript script that uses WMI to enlist the protoclos and enable
named Pipes:
' enum protocols and show status
set wmi =
GetObject("WINMGMTS:\\.\root\Microsoft\SqlServer\ComputerManagement")
for each prop in wmi.ExecQuery("select * " & _
"from ServerNetworkProtocol " & _
"where InstanceName = 'mssqlserver'")
WScript.Echo prop.ProtocolName & " - " & _
prop.ProtocolDisplayName & " " & _
prop.Enabled
next
' enable named pipes
for each changeprop in wmi.ExecQuery("select * " & _
"from ServerNetworkProtocol " & _
"where InstanceName = 'mssqlserver' and " & _
"ProtocolName = 'Np'")
changeprop.SetEnable()
next
--
Dejan Sarka
http://www.solidqualitylearning.com/blogs/
.
- References:
- Re: enable TCPIP Protocols by script
- From: Dejan Sarka
- Re: enable TCPIP Protocols by script
- Prev by Date: Re: enable TCPIP Protocols by script
- Next by Date: Re: EFS,SQL Server 2005 and Windows 2003
- Previous by thread: Re: enable TCPIP Protocols by script
- Next by thread: Re: EFS,SQL Server 2005 and Windows 2003
- Index(es):