Find which program is using a network port — via Microsoft Learn
When an app complains a port is already in use, or you see an unexpected connection, these commands map ports to process IDs and program names.
Takes effect right away
Command
Run in an administrator PowerShell / Terminal window.
Get-NetTCPConnection -LocalPort 8080
Get-Process -Id (Get-NetTCPConnection -LocalPort 8080).OwningProcess | Select-Object Name, Id, Path
netstat -anoUndo
# Read-only: nothing to undo.Change 8080 to your port.netstat -anolists every connection and listening port with its PID; match the PID in Task Manager's Details tab.netstat -bshows the program name directly but needs an elevated prompt and is slow.
Sources
- Get-NetTCPConnection — by Microsoft Learn
- netstat — by Microsoft Learn
- MSSQLSERVER_35250 — find the port-owning process — by Microsoft Learn
- Source reviewed
- 2026-11-02
- Link checked
- 2026-11-02
- Tested hands-on
- Not by Oddbyte.Me
Oddbyte.Me hasn't tried this on every Windows build, so keep the undo handy.