How to measure network performance using iPerf and PowerShell

iPerf allows administrators to set up a receiving program on a remote computer and a broadcast program on another computer to start transferring data between them.

If you've ever had problems with network latency or low bandwidth in wide area networks WAN or even on a local area network, a great tool can be used here is iPerf. This is a free tool that allows administrators to set up a receiving program on a remote computer and a broadcast program on another computer to transfer data between them. iPerf is a great tool, but a bit difficult to use. This is an example of a typical iPerf command.

iperf -c 10.12.240.32 -u -p 12345 -t 30 -b 250M

On Windows, iPerf uses the old parameters, one word because it is EXE. But now we have PowerShell to work with tools like this, but the problem here is that iPerf is an EXE and not a PowerShell function. We can fix this problem by creating a few wrapper functions that compile all the values ​​that iPerf.exe needs through the PowerShell function.

How to measure network performance using iPerf and PowerShell Picture 1

To work with iPerf in the way PowerShell, download a community module called iPerfAutomate. This module is available on PowerShell Gallery and can be installed by running Install-iPerfAutomate -Name Module. After installation, you can see only two commands, but these two commands have a lot of code behind.

PS C:> Get-Command -Module iPerfAutomate

Command Type Name Version Source
----------- ---- ------- ------
Function New-IperfSchedule 1.0.2 iPerfAutomate
Function Start-IPerfMonitorTest 1.0.2 iPerfAutomate

Technically, only specific iPerf commands are located in Start-IperfMonitorTest. This is the command to perform all necessary settings to perform network testing between the two places. New-IperfSchedule is a command that allows users to set scheduled tasks to run Start-IperfMonitorTest.

Start-iPerfMonitorTest has two sets of parameters: Site and Server. Basically, in a command, you need to provide FromServerName and ToServerName. Then Start-iPerfMonitorTest will copy iPerf to both servers, start transferring, return results and clean up.

Start-iPerfMonitorTest -FromServerName SQLSRV1 -ToServerName WEBSRV1

Connecting to host SQLSRV1, port 5201
[4] local 2607: fcc8: ace7: 1700: 60d4: c299: d02e: 3c43 port 55739
connected to 2607: fcc8: ace7: 1700: e4e1: c511: e38b: 4f05 port
5201
[ID] Interval Transfer Bandwidth
[4] 0.00-1.00 sec 208 MBytes 1.73 Gbits / sec
[4] 1.00-2.00 sec 223 MBytes 1.87 Gbits / sec
[4] 2.00-3.00 sec 218 MBytes 1.83 Gbits / sec
[4] 3.00-4.00 sec 220 MBytes 1.85 Gbits / sec
[4] 4.00-5.00 sec 245 MBytes 2.05 Gbits / sec
[4] 5.00-6.00 sec 251 MBytes 2.10 Gbits / sec
[4] 6.00-7.00 sec 248 MBytes 2.09 Gbits / sec
[4] 7.00-8.00 sec 266 MBytes 2.23 Gbits / sec
[4] 8.00-9.00 sec 243 MBytes 2.04 Gbits / sec
[4] 9.00-10.00 sec 255 MBytes 2.14 Gbits / sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ID] Interval Transfer Bandwidth
[4] 0.00-10.00 sec 2.32 GBytes 1.99 Gbits / sec
sender
[4] 0.00-10.00 sec 2.32 GBytes 1.99 Gbits / sec
receive

r iperf Done.

You can see that instead of having to make sure iPerf EXE is on a local and remote computer, you just need to run a PowerShell function to start the quick check. Start-IPerfMonitorTest also supports setting up tests from the entire site instead of a separate server. Maybe you can't remember the server in SITE A or SITE B, instead of setting up the test by server name, you can "map" the server name to a website and just set up the tests according to websites.

Start-iPerfMonitorTest -FromSite Main -ToSite Vegas

The iPerfAutomate module simplifies a lot of great tools and allows users to quickly and easily set up one or more network performance tests.

See more:

  1. 7 free network tools for Admin
  2. Increase network performance by installing Tomato on the Router
  3. Check network performance with PRTG for free version
4 ★ | 229 Vote

May be interested

  • How to check Internet speed with cmd commandHow to check Internet speed with cmd command
    checking the internet speed will help you know the download speed and upload of the network you are using is exactly what the network provider tells you. using this cmd command will help you measure network speed without using software.
  • Use PowerShell to download any file on Windows 10Use PowerShell to download any file on Windows 10
    windows powershell is a tool built into windows 10. this tool has the ability to set up more features than command prompt, better operating system control .... most likely, powershell will replace command prompt in the future.
  • How to Enable and Use Script Execution Policy in Windows PowerShellHow to Enable and Use Script Execution Policy in Windows PowerShell
    by default, script execution on powershell is disabled as a security measure to prevent malicious scripts from running on the system. the following article will show you two ways to enable script execution policy in windows powershell.
  • PowerShell command in WindowsPowerShell command in Windows
    windows powershell is an executable command line and a scripting language specifically designed for system administrators.
  • How to use PowerShell's default parameter to change the command behaviorHow to use PowerShell's default parameter to change the command behavior
    many people like to use powershell because it allows them to do things that can't be done with the windows gui. however, it is undeniable that some powershell cmdlets can be tedious or complicated. but what if there is a way to edit these cmdlets and get them to 'behave' the way you want?
  • How to check PowerShell version in Windows 10How to check PowerShell version in Windows 10
    powershell is one of the extremely useful command tools for advanced windows 10 users.
  • Instructions on how to use PowerShell in Windows Server 2012Instructions on how to use PowerShell in Windows Server 2012
    what is powershell? windows powershell is a command-line shell language interpreter and scripting language specifically designed for system administrators. built on the .net framework, windows powershell helps it professionals control and automate windows operating system administration tasks as well as applications running on windows server environments.
  • Free network tools for AdminFree network tools for Admin
    in this article we will show you 7 free networking tools, which are really useful tools for network administrators.
  • What is Windows PowerShell? How to use Windows PowerShellWhat is Windows PowerShell? How to use Windows PowerShell
    do you want to learn the features of windows powershell but don't know how? suggestions for you what is windows powershell? the most convenient way to use windows powershell.
  • How to add the Open Powershell Here option to the context menu on WindowsHow to add the Open Powershell Here option to the context menu on Windows
    to open and use powershell faster and simpler when needed, you can add the 'open powershell here' option to the context menu - the menu when you right-click. in the following article, network administrator will show you how to add the 'open powershell here' option to the context menu on the windows operating system.