Quantcast
Channel: The VBScript Network and Systems Administrator's Cafe » DataCenter
Viewing all articles
Browse latest Browse all 10

Writing a BGINFO like Script: Displaying Network Adapter Speed with WMI via the Win32_NetworkAdapter class

$
0
0

I recently had to provide the information displayed with BGINFO on a number of systems. Unfortunately, BGInfo only generates a bitmap, so far as I know, so I decided to write a script to generate the information and use this displayed information to send back to the person who requested it.

The function below is a part of the script I mentioned. It retrieves and returns text that represents the speed of teh network adapters in a system.

You can view all the scripts in this BGINFO series here.

Here is the code:

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


Viewing all articles
Browse latest Browse all 10

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>