11 Sep 2023 - tags: Windows  Powershell  Network 

Find Windows process listening on network port

To find the Windows process listening on a certain port, open up a Powershell and type:

$PORT=22222
Get-Process -Id (Get-NetTCPConnection -LocalPort $PORT).OwningProcess
Get-Process -Id (Get-NetUDPConnection -LocalPort $PORT).OwningProcess