HP DL360 HP Insight Management WBEM Providers for Windows Server 2003 and Wind - Page 29

WScript.Echo Asset tag: & objComputerSystemChassis.UserTracking

Page 29 highlights

strNamespace = "\root\hpq" Set objWMIService = GetObject("winmgmts:\\" & strComputer & strNamespace) Set colComputerSystem = objWMIService.ExecQuery("Select * from HP_WinComputerSystem") For Each objComputerSystem in colComputerSystem WScript.Echo "Caption: " & objComputerSystem.Caption For Each objStatusDescription in objComputerSystem.StatusDescriptions WScript.Echo "Status description: " & objStatusDescription Next For Each objOperationalStatus in objComputerSystem.OperationalStatus WScript.Echo "Operational status: " & objOperationalStatus Next Next The following VBScript code is used to display system firmware version: strComputer = "." strNamespace = "\root\hpq" Set objWMIService = GetObject("winmgmts:\\" & strComputer & strNamespace) Set colSystemROMFirmware = objWMIService.ExecQuery("Select * from HP_SystemROMFirmware") For Each objSystemROMFirmware in colSystemROMFirmware WScript.Echo "Caption: " & objSystemROMFirmware.Caption WScript.Echo "Version: " & objSystemROMFirmware.VersionString WScript.Echo Next This VBScript code is used to display computer system chassis model name, serial number and asset tag: strComputer = "." strNamespace = "\root\hpq" Set objWMIService = GetObject("winmgmts:\\" & strComputer & strNamespace) Set colComputerSystemChassis = objWMIService.ExecQuery("Select * from HP_ComputerSystemChassis") For Each objComputerSystemChassis in colComputerSystemChassis WScript.Echo "Model: " & objComputerSystemChassis.Model WScript.Echo "Serial number: " & objComputerSystemChassis.SerialNumber WScript.Echo "Asset tag: " & objComputerSystemChassis.UserTracking Next Insight Providers architecture 29

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41

Insight Providers architecture 29
strNamespace = "\root\hpq"
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
strNamespace)
Set colComputerSystem = objWMIService.ExecQuery("Select * from
HP_WinComputerSystem")
For Each objComputerSystem in colComputerSystem
WScript.Echo "Caption: " & objComputerSystem.Caption
For Each objStatusDescription in
objComputerSystem.StatusDescriptions
WScript.Echo "Status description: " & objStatusDescription
Next
For Each objOperationalStatus in objComputerSystem.OperationalStatus
WScript.Echo "Operational status: " & objOperationalStatus
Next
Next
The following VBScript code is used to display system firmware version:
strComputer = "."
strNamespace = "\root\hpq"
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
strNamespace)
Set colSystemROMFirmware = objWMIService.ExecQuery("Select * from
HP_SystemROMFirmware")
For Each objSystemROMFirmware in colSystemROMFirmware
WScript.Echo "Caption: " & objSystemROMFirmware.Caption
WScript.Echo "Version: " & objSystemROMFirmware.VersionString
WScript.Echo
Next
This VBScript code is used to display computer system chassis model name, serial number and asset tag:
strComputer = "."
strNamespace = "\root\hpq"
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
strNamespace)
Set colComputerSystemChassis = objWMIService.ExecQuery("Select * from
HP_ComputerSystemChassis")
For Each objComputerSystemChassis in colComputerSystemChassis
WScript.Echo "Model: " & objComputerSystemChassis.Model
WScript.Echo "Serial number: " &
objComputerSystemChassis.SerialNumber
WScript.Echo "Asset tag: " & objComputerSystemChassis.UserTracking
Next