Use PowerShell to display network statistics over time

Here’s a tip from my colleague Ed Wilson (the Microsoft Scripting Guy) about how to use PowerShell to display network statistics over time.

Question: How can you use Windows PowerShell to display network statics over time for your review?

Answer: Create an array and then pipe the commands to the Foreach-Object cmdlet (% is an alias). Call the Get-NetAdapterStatistics inside the loop, and pipe the results to the Out-GridView cmdlet (ogv is an alias). Control the amount of time between captures by changing the value of the sleep command. The command appears here:

1..2 | % {Get-NetAdapterStatistics -Name *external* | select ReceivedBytes, SentBytes; sleep 5} | ogv

Mitch Tulloch is a nine-time recipient of the Microsoft Most Valuable Professional (MVP) award and a widely recognized expert on Windows administration, deployment and virtualization.  For more information see

Ed Wilson is the bestselling author of eight books about Windows Scripting, including Windows PowerShell 3.0 Step by Step, and Windows PowerShell 3.0 First Steps. He writes a daily blog about Windows PowerShell call Hey, Scripting Guy! that is hosted on the Microsoft TechNet Script Center; for more PowerTips check out the Hey, Scripting Guy! blog.

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top