Created
October 22, 2021 12:45
-
-
Save TheRockStarDBA/db38b3414720fc8d9e2271ca08d84af6 to your computer and use it in GitHub Desktop.
ports and count of connections - powershell Net TCP Connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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