Users Guide

Set colInstances = GetObject("WinMgmts:{impersonationLevel=impersonate}//"&_
strComputerName&"/"&strNameSpace).ExecQuery(strWQLQuery,"WQL",
NULL)
'*** 仅使用第一个实例检索资产标签、服务标签和 BIOS
'*** 版本
For Each objInstance in colInstances
strMessage="资产标签:"
strMessage = strMessage & objInstance.Properties_.Item
("AssetTag").Value
strMessage=strMessage&vbCRLF&"服务标签:"
strMessage = strMessage & objInstance.Properties_.Item
("ServiceTag").Value
strMessage=strMessage&vbCRLF&"BIOS版本:"
strMessage = strMessage & objInstance.Properties_.Item
("BIOSVersion").Value
ExitFor
Next
'*** 显示结果
WScript.Echo strMessage
'*** Sub 用于显示脚本的正确用法
Sub Usage()
Dim strMessage
strMessage = "语法不正确。应运行:" & vbCRLF & _
"cscript.exe//nologoSampleSystemSummary.vbs<系统名称>"
WScript.Echo strMessage
End Sub)
更改 BIOS
下面是将更改 Dell OMCI 客户端的 BIOS 密码的示例 VBScript
'****************************************************
'*** Name: SampleBIOSPwd.vbs
'*** Purpose: To change the BIOS password on a Dell OMCI client.
'*** Usage: cscript.exe //nologo SampleBIOSPwd.vbs <systemname> "<old
'*** pwd> space <new pwd>"
'***
'*** This sample script is provided as an example only, and has not been
'*** tested, nor is warranted in any way by Dell; Dell disclaims any
'*** liability in connection therewith. Dell provides no technical
'*** support with regard to such scripting. For more information on WMI
'*** scripting, refer to applicable Microsoft documentation.
'****************************************************
'*** Declare variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim strKeyValue
Dim objInstance
Dim strPropName
Dim strPwd
'*** Check that the right executable was used to run the script
'*** and that all parameters were passed
If (LCase(Right(WScript.FullName, 11)) <> "cscript.exe" ) Or _
(Wscript.Arguments.Count<2)Then
CallUsage()
WScript.Quit
End If
'*** Initialize variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_Configuration"
strKeyValue = "Configuration"
strPropName = "Password"
strPassEncryptPropName = "PasswordEncrypted"
strPwd = WScript.Arguments(1)
'*** Retrieve the instance of Dell_Configuration class (there should
'*** only be 1 instance).
Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate}//" &_
strComputerName&"/"&strNameSpace&":"&strClassName&"="&_
Chr(34)&strKeyValue&Chr(34))
'*** Set the new value for the property and save the instance
objInstance.Properties_.Item(strPropName).Value = strPwd
objInstance.Properties_.Item(strPassEncryptPropName).Value = 0
objInstance.Put_
'*** If any errors occurred, let the user know
If Err.Number <> 0 Then