Windows – How to Get Network Utilization from Command Line

command linenetwork-adapterwindows

In the Windows task manager there is a handy network tab which shows the link speed and network utilization (in percentage of available bandwidth) for connected network adapters:

Task Manager Screenshot

Is there a way to get this information through the command line?

Best Answer

There are a (large?) number of command line options that give information on network usage. This deals with that, and answers there have a significant overlap with the present OP. Many of them do not provide percentage bandwidth usage, as asked in the OP.

  1. The option with Wireshark was given above.

  2. typeperf (Windows native) is also relevant, with a few options. typeperf -q "Network Interface" lists all the objects. Then, use typeperf "\Network Interface(*)\... with the following options:

    \Network Interface(*)\Current Bandwidth
    \Network Interface(*)\Bytes Total/sec
    \Network Interface(*)\Bytes Received/sec
    \Network Interface(*)\Bytes Sent/sec
    \Network Interface(*)\Packets/sec
    \Network Interface(*)\Packets Received/sec
    \Network Interface(*)\Packets Sent/sec
    

    Note that the formula is ((Total Bytes/Sec * 8)/current bandwidth) * 100. Other useful options:

    \Network Interface(*)\Packets Received Unicast/sec
    \Network Interface(*)\Packets Received Non-Unicast/sec
    \Network Interface(*)\Packets Received Discarded
    \Network Interface(*)\Packets Received Errors
    \Network Interface(*)\Packets Received Unknown
    \Network Interface(*)\Packets Sent Unicast/sec
    \Network Interface(*)\Packets Sent Non-Unicast/sec
    \Network Interface(*)\Packets Outbound Discarded
    \Network Interface(*)\Packets Outbound Errors
    \Network Interface(*)\Output Queue Length
    \Network Interface(*)\Offloaded Connections
    

    You can use flag -sc <samples> (Specifies the number of samples to collect. The default is to collect data until CTRL+C is pressed), see official documentation.
    Flag -o <filename> (Specifies the path for the output file, or the SQL database. The default is STDOUT (written to the command window).) may also be useful.

  3. An interesting script, which may be customized to give various pieces of information and format it, is given here.