Question: I’ve installed SQL Server 2012. I’d like to enable TCP\IP for a port number. Normally I open SQL Server Configuration Manager | SQL Server network Configuration | Protocols for MYINSTANCE | Select TCP\IP.
Rather than manually going through the process for every server, I’d like to script this step as part of the Installation and Configuration. What methods are available ?
Answer: It is possible to script these steps. I use two reliable methods. Method 1 uses the built-in SQL Server installation switches . Method 2 uses Powershell
Method 1 – Install SQL Server and use the /TCPENABLED = 1 switch.
You can add this switch to an installation sequence. This method is useful if you are automating silent installs read more on How to Install SQL Server service pack silently
Method 2 – Use a powershell script to enable TCPIP
As part of a post installation task use a powershell script to initialize the Microsoft.SqlServer.Management.Smo namespace . Once initialized you can access the various functions to firstly establish the current status of TCP\IP (IsEnabled) and secondly alter the status from false to true.(Alter()).
Applying scripted , repeatable methods of SQL Server configurations has a big impact on DBA productivity
Read more on automation, silent installs and DBA mistakes