dbatools is a free PowerShell module with over 200 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Set-DbaTcpPort

This function changes the TCP port used by the specified SQL Server.

Screenshots

dbatools-Set-DbaTcpPort

Examples

Sets the port number 1433 for allips on the default instance on SqlInstance2014a.

Set-DbaTcpPort -SqlInstance SqlInstance2014a -Port 1433

Sets the port number 1433 for IP 192.168.1.22 on the sqlexpress instance on winserver.

Set-DbaTcpPort -SqlInstance winserver\sqlexpress -IpAddress 192.168.1.22 -Port 1433

Sets the port number 1337 for ALLIP’s on SqlInstance SQLDB2014A and SQLDB2016B.

Set-DbaTcpPort -SqlInstance ‘SQLDB2014A’ ,’SQLDB2016B’ -port 1337

Author

This command was created by [email protected]

Get-Help

From PowerShell, execute Get-Help Set-DbaTcpPort -Detailed for more information on this function.

Source Code

Want to see the source code? View Set-DbaTcpPort.ps1 on GitHub
 

Related commands