I'm thinking if it possible to change SQL Server 2008 Instance TCP Ports to 1433 using cmd and without using SQL Server Configuration Manager.
I just want to apply this to my application setup, My client wants it to be in multi-user mode.
I know how to enable TCP/IP using cmd. And I know how to create a script to allow a specific port in windows firewall.
Thanks in advance. Please leave a comment if my details are not enough to answer my question.
Not quite cmd, but powershell is the new cmd. :)
import-module sqlps;
$MachineObject = new-object ('Microsoft.SqlServer.Management.Smo.WMI.ManagedComputer') "computername"
$instance = $MachineObject.getSmoObject(
"ManagedComputer[@Name='computername']/" +
"ServerInstance[@Name='instancename']"
)
$instance.ServerProtocols['Tcp'].IPAddresses['IPAll'].IPAddressProperties['TcpPort'].Value = "1433"
$instance.ServerProtocols['Tcp'].IPAddresses['IPAll'].IPAddressProperties['TcpDynamicPorts'].Value = ""
$instance.ServerProtocols['Tcp'].Alter()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With