Powershell: get TCP counters for IPv4

Performance issues. Everybody had them once, and more 🙂
If you are using Windows 2012+ and Powershell, you can use the Get-Counter command in order to provide you more information regarding the TCP connections.
In the example below, we are getting the counters for IPv4 TCP:

Get-Counter -Counter \TCPv4\*

This will give an output like this:

Timestamp                 CounterSamples ---------                 -------------- 05/01/2017 19:39:23       \\btp154713\tcpv4\segments/sec :                           208.768490989083                            \\btp154713\tcpv4\connections established :                           62                            \\btp154713\tcpv4\connections active :                           1085102                            \\btp154713\tcpv4\connections passive :                           239537                            \\btp154713\tcpv4\connection failures :                           742269                            \\btp154713\tcpv4\connections reset :                           7988                            \\btp154713\tcpv4\segments received/sec :                           105.882583946617                            \\btp154713\tcpv4\segments sent/sec :                           102.885907042467                            \\btp154713\tcpv4\segments retransmitted/sec :                           3.9955692055327

Quite interesting isn’t it? :p Do you want to have statistics during, for example, 10 seconds? Use the sampleInterval option:

Get-Counter -Counter \TCPv4\* -SampleInterval 10
Share your love