Átomo
35Ns
Rede · Windows

Get-NetTCPConnection / netstat

Abrir na tabela

Definição

Mostram portas abertas e qual processo as usa. Resolve o "porta já em uso".

Exemplos

1. Quem usa a porta
Get-NetTCPConnection -LocalPort 8080 | Select-Object OwningProcess
netstat -ano | findstr :8080
2. Portas em escuta
Get-NetTCPConnection -State Listen | Select-Object LocalPort, OwningProcess
3. Nome do processo dono
Get-Process -Id (Get-NetTCPConnection -LocalPort 8080).OwningProcess

No mesmo grupo