Posts Tagged ‘find process listening on port windows’

How to Find Which Process is Listening on a Given Port in Windows 10

December 28th, 2020 by Admin

Is there a way to determine which application is listening on a certain port? How do I see if a particular port is in use on a windows PC? In this tutorial we’ll show you how to find out which process is listening on a given port in Windows 10, by using Command Prompt or PowerShell.

Part 1: Find the ID of the Process Using a Given Port

To get started, open the elevated Command Prompt and run the following command:
netstat -aon

It will display a list of TCP and UDP ports currently listening on your computer. In our case, the TCP port 3389 is used by a process whose process ID (PID) is 1272.

You can also use PowerShell to find out which process is listening on the TCP port 3389. Just enter this command:
Get-Process -Id (Get-NetTCPConnection -LocalPort Your_Port_Number).OwningProcess

For UDP port, use this command instead:
Get-Process -Id (Get-NetUDPEndpoint -LocalPort Your_Port_Number).OwningProcess

Part 2: Get Process Name by its ID

In order to find the process name by its process ID, open Task Manager and go to the Processes tab. Sort the list of process by clicking the column header that is labeled “PID“. In our case, the process associated with the PID 1272 is Remote Desktop Services.

If you do not see a PID column, right-click the header of any column and select the PID option.

Conclusion

That’s how you can find out which process is listening on a given port in Windows 10, by using Command Prompt or PowerShell. If you would rather use a third-party software to check ports in use, TCPView should be your good choice.