Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / PowerShell / Testing Internet Speed from Windows Command Prompt (PowerShell)

July 2, 2024

Testing Internet Speed from Windows Command Prompt (PowerShell)

Many online services allow you to test your Internet connection speed in real-time. If you need to regularly collect Internet connection speed metrics from your provider for monitoring, you can use the popular Speedtest console client from Ookla. Let’s look at how to measure the speed of an Internet connection using the Windows command prompt or a PowerShell script.

Download the console speedtest.exe tool for Windows from https://www.speedtest.net/apps/cli and extract it to a local directory.

To automatically test network download and upload speeds to the nearest Speedtest service location, run the command

.\speedtest.exe

speedtest.exe - Internet speed test from WIndows CLI

The tool returns download and upload speeds (in Mbps), network latency from your computer to the nearest Speedtest server. Since there are many SpeedTest locations worldwide, this will be the speed of your internet connection.

You can manually select the ISP, country, and city to test your Internet connection speed to. List the nearest test points and copy the ID:

.\speedtest.exe -L

Run the speed test against the target server:

.\speedtest.exe -s 11787

speedtest-cli server list

The speedtest command can return results in structured formats (CSV, JSON, TSV), which is useful if you need to extract additional data from the results or send the test result to the monitoring system.

For example, you can use a PowerShell script to get the results of an Internet speed test:

$speedtestcmd = & "C:\ps\speedtest.exe" --accept-license -s 37149 -f json
$speedtestresult=ConvertFrom-Json $speedtestcmd
$result=[PSCustomObject]@{
   Download = [math]::round($speedtestresult.download.bandwidth/1MB, 5)*8
   Upload = [math]::round($speedtestresult.upload.bandwidth/1MB, 5)*8
}
$result

Internet download and upload speed test with PowerShell

The speedtest command returns a JSON object that can be processed using PowerShell. Extract the download and upload speed values from JSON and convert the values from bits to megabits.

You can send the Internet speed test results to your monitoring system as metrics (Getting data into Zabbix from a PowerShell script).

On a local network, you can use the iperf tool to test the network bandwidth between two machines.
0 comment
3
Facebook Twitter Google + Pinterest
PowerShellWindows 10Windows 11
previous post
Configure File and Folder Access Auditing on Windows (GPO)
next post
Permanently Disable Driver Signature Enforcement on Windows 11

Related Reading

Fix: Remote Desktop Licensing Mode is not Configured

August 24, 2023

Managing Windows Firewall Rules with PowerShell

March 11, 2024

Installing Language Pack in Windows 10/11 with PowerShell

September 20, 2023

How to Assign (Passthrough) a Physical GPU to...

June 11, 2024

Extend an Expired User Password in Active Directory

December 23, 2024

How to Create UEFI Bootable USB Drive to...

March 13, 2024

Tracking Printer Usage with Windows Event Viewer Logs

March 12, 2024

Adding ESXi Host to VMware vCenter Server (vCSA)

March 12, 2024

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Encrypt Any Client-Server App Traffic on Windows with Stunnel

    June 12, 2025
  • Failed to Open the Group Policy Object on a Computer

    June 2, 2025
  • Remote Desktop Printing with RD Easy Print Redirection

    June 2, 2025
  • Disable the Lock Screen Widgets in Windows 11

    May 26, 2025
  • Configuring Windows Protected Print Mode (WPP)

    May 19, 2025
  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Delete Old User Profiles in Windows
  • Fix: Remote Desktop Licensing Mode is not Configured
  • How to Install Remote Server Administration Tools (RSAT) on Windows
  • How to Create UEFI Bootable USB Drive to Install Windows
  • Configuring User Profile Disks (UPD) on Windows Server RDS
  • Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11
  • How to Allow Non-Admin User to Start/Stop Service in Windows
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top