Access Computer System Product Information Using WMI

By ServerWatch Staff (Send Email)
Posted Sep 5, 2000


by John Loomes

The Win32_ComputerSystemProduct object in WMI allows you to query various information about hardware platforms. This object is used by management tools such as SMS 2.0 to gather hardware inventory.

The Win32_ComputerSystemProduct object in WMI allows you to query various information about hardware platforms. This object is used by management tools such as SMS 2.0 to gather hardware inventory.

The script below is a very simple example of how to access this information using WMI and VBScript. The example is for a single machine only, and pipes the information gathered into messages boxes. You could easily expand on this to cycle through a list of machines or thru an Active Directory Container, and record the information in a log, database or spreadsheet......

On Error Resume Next

Dim system, ServiceSet

Set ServiceSet=GetObject("winmgmts:{impersonationLevel=impersonate}!//MYPCName").InstancesOf("Win32_ComputerSystemProduct")

For each system in ServiceSet

Msgbox system.Caption

Msgbox system.Description

msgbox system.IdentifyingNumber

msgbox system.Name

next

Set ServiceSet = Nothing


Please note that this is provided 'as is' with no warranties i.e. don't blame me if it all goes wrong!

Page 1 of 1


Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.