Skip to content

Instantly share code, notes, and snippets.

@michael-wolfenden
Created August 27, 2019 02:12
Show Gist options
  • Save michael-wolfenden/7c0ec8da2b89bba7622a2991505c003e to your computer and use it in GitHub Desktop.
Save michael-wolfenden/7c0ec8da2b89bba7622a2991505c003e to your computer and use it in GitHub Desktop.
Get-NetTCPConnection | Group-Object -Property State, OwningProcess | Select -Property Count, Name, @{Name="ProcessName";Expression={(Get-Process -PID ($_.Name.Split(',')[-1].Trim(' '))).Name}}, Group | Sort Count -Descending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment