Displaying Network Adapter Speed with WMI via the Win32 NetworkAdapter class

Quick little script to do the above..

Function GetNetworkSpeed(strComputer)
Dim colItems, objItem, address
Dim StrQuery
Dim objWMIService
StrQuery = “SELECT * FROM Win32_NetworkAdapter”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2″)
Set colItems = objWMIService.ExecQuery(strQuery,,48)
For Each objItem in colItems
GetNetworkSpeed = GetNetworkSpeed & vbTab & objItem.ProductName & vbCr
Next
End Function

 

Or do it easier in Powershell. Powershell is almost always preferable 😉

Get-NetAdapter | select interfaceDescription, name, status, linkSpeed

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.