How to verify the listening port of SQL Server on the local machine?
Situation
You have already configured TCP/IP listening port for SQL Server from SQL Server Configuration Manager.
But if you want to make sure that the port is opened and the server listens to the port, then what should you do?
Before you start, if you want to verify the SQL Server port is opened from the client computer, then take a look here.
Traditional command prompt
In a traditional command prompt, you can use "netstat" command.
netstat -a -b | findstr <port number>
e.g. SQL Server Service port is "1433".
PowerShell Command
You can use "Get-Process" cmdlet + "Get-NetTCPConnection" cmdlet.
Get-Process -Id (Get-NetTCPConnection -LocalPort <port number>).OwningProcess
e.g. SQL Server Service port is "1433".
PowerShell looks way much better.
No comments:
Post a Comment