Hp Insight Management WBEM Providers Instrukcja Użytkownika Strona 30

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 46
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 29
Microsoft Visual Basic Scripting Edition examples
You can write scripts to obtain data from the Insight Providers using Microsoft® Visual Basic Scripting
Edition (VBScript) or any other scripting language that supports Microsoft® ActiveX.
The following are example codes for accessing Insight Provider data using VBScript code.
This VBScript code is used to display computer system operational status information:
strComputer = "."
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)
Insight Providers architecture30
Przeglądanie stron 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 ... 45 46

Komentarze do niniejszej Instrukcji

Brak uwag