Determine which process is using a specific port using PowerShell.

If you find that a process is using a TCP port and you want to know which process is using that port it's easy with PowerShell using the Get-NetTCPConnection and Get-Process cmdlets.


# Determine which process is using port 443

$owningProcess = (Get-NetTCPConnection -State Listen -LocalPort 443|SELECT OwningProcess)[0];
$processName = Get-Process -Id $owningProcess.OwningProcess|SELECT ProcessName;
Write-Host "Port 443: $($processName.ProcessName)";





Comments

Popular posts from this blog

SOLVED: Exchange Online Management PowerShell Connect-ExchangeOnline bug "A window handle must be configured. See https://aka.ms/msal-net-wam#parent-window-handles"

System error 86 has occurred. The specified network password is not correct.

The security identifier of the "NT SERVICE\WdiServiceHost" account is "S-1-5-80-3139157870-2983391045-3678747466-658725712-1809340420"