VBS Script To Retrieve A Remote Machines Adapter Link Speeds

 

This VBS script will take a machine name from an input dialog box and write the adapter name, whether or not it is active and return the link speed(s) in KB or MB per second as needed to an excel spreadsheet.

 

VBS Script:

 

strComputer = InputBox ("Enter Machine Name")

 

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True

objExcel.Workbooks.Add

intRow = 2

 

objExcel.Cells(1, 1).Value = "Name"

objExcel.Cells(1, 2).Value = "Active"

objExcel.Cells(1, 3).Value = "Speed"

 

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\Wmi")

Set colItems = objWMIService.ExecQuery("Select * From MSNdis_LinkSpeed")

For Each objItem in colItems

objExcel.Cells(intRow, 1).Value = objItem.InstanceName

objExcel.Cells(intRow, 2).Value = objItem.Active

If objItem.NdisLinkSpeed < 10000 Then

strNICSpeed = objItem.NdisLinkSpeed / 10 & " KBps"

ElseIf objItem.NdisLinkSpeed > 10000 Then

strNICSpeed = objItem.NdisLinkSpeed / 10000 & " MBps"

End If

objExcel.Cells(intRow, 3).Value = strNICSpeed

intRow = intRow + 1

Next

 

objExcel.Range("A1:C1").Select

objExcel.Selection.Interior.ColorIndex = 19

objExcel.Selection.Font.ColorIndex = 11

objExcel.Selection.Font.Bold = True

objExcel.Cells.EntireColumn.AutoFit

 

MsgBox "Done"

 

 

Published Sunday, June 24, 2007 8:23 AM by dhite
Filed under:

Comments

# Script To Get A Local Machines Adapter Link Speed

This By Request VBS script will allow you to see your local machines Adapter Link Speed. VBS Script:

Saturday, March 22, 2008 7:16 PM by Don Hite