Skip to content

Instantly share code, notes, and snippets.

@TheRockStarDBA
Created October 22, 2021 12:45
Show Gist options
  • Save TheRockStarDBA/db38b3414720fc8d9e2271ca08d84af6 to your computer and use it in GitHub Desktop.
Save TheRockStarDBA/db38b3414720fc8d9e2271ca08d84af6 to your computer and use it in GitHub Desktop.
ports and count of connections - powershell Net TCP Connection
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