Configuring SQL Server 2008 R2 to be accessible from outside the installed server using command line tools 

Thursday, August 19, 2010 4:23 PM

confiure surface area sql server 2008 r2 windows core wmic netsh advfirewall protocol tcp

If you followed my previous blog post on installing SQL Server in the core install of Windows Server 2008 R2, you will not be able to access the SQL Server from outside that Server. The firewall will block any requests from an external client. Additionally you may want to enable the TCP/IP protocol to access the SQL server as that is more preffered over the named pipes protocol.

As this is a install on the core, no GUI tools are available for the administration. Fortunately a command line tool for Windows Management Instrumentation exists which can be used to accomplish the network protocol changes. Execute the following command at the command prompt to enable TCP/IP protocol:

WMIC /NAMESPACE:\\root\Microsoft\SqlServer\ComputerManagement10 PATH ServerNetworkProtocol WHERE ProtocolName='Tcp' CALL SetEnable

If you would like to disable the Named Pipes protocol, you would execute:

WMIC /NAMESPACE:\\root\Microsoft\SqlServer\ComputerManagement10 PATH ServerNetworkProtocol WHERE ProtocolName='Np' CALL SetDisable

Finally to open up the port through the Windows firewall, you need to execute the following command:

netsh advfirewall firewall add rule name=”Open Port 1433” dir=in action=allow protocol=TCP localport=1433

Restart the SQL Service (or restart the server) and now you have a fully installed SQL Server 2008 R2 Database Engine, that is accessible to other computers on your network.

confiure surface area sql server 2008 r2 windows core wmic netsh advfirewall protocol tcp

Share This Using Popular Bookmarking Services
Comments are closed on this post.