Users Guide
End If
'*** Initialize variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_SystemSummary"
strKeyName = "Name"
'*** WQL Query to retrieve instances of Dell_SystemSummary
strWQLQuery = "SELECT * FROM " & strClassName & " WHERE " & _
strKeyName&"="&Chr(34)&strComputerName&Chr(34)
'*** Retrieve instances of Dell_Configuration class (there should only
'*** be 1 instance).
Set colInstances = GetObject("WinMgmts:{impersonationLevel=impersonate}//"&_
strComputerName&"/"&strNameSpace).ExecQuery(strWQLQuery,"WQL",
NULL)
'*** Use only first instance to retrieve asset tag, service tag, and BIOS
'*** version
For Each objInstance in colInstances
strMessage="AssetTag:"
strMessage=strMessage&objInstance.Properties_.Item
("AssetTag").Value
strMessage=strMessage&vbCRLF&"ServiceTag:"
strMessage=strMessage&objInstance.Properties_.Item
("ServiceTag").Value
strMessage=strMessage&vbCRLF&"BIOSVersion:"
strMessage=strMessage&objInstance.Properties_.Item
("BIOSVersion").Value
ExitFor
Next
'*** Display the results
WScript.Echo strMessage
'*** Sub used to display the correct usage of the script
Sub Usage()
Dim strMessage
strMessage = "incorrect syntax. You should run: " & vbCRLF & _
"cscript.exe//nologoSampleSystemSummary.vbs<systemname>"
WScript.Echo strMessage
End Sub
('****************************************************
'*** 名称:SampleSystemSummary.vbs
'*** 目的:显示 Dell OMCI 客户端的资产标签、服务标签和
'*** BIOS 版本。
'*** 用法:cscript.exe //nologo SampleSystemSummary.vbs <系统名称>
'***
'*** 此示例脚本只是一个示例,未经
'*** 测试,Dell 也不作任何担保;Dell 对
'*** 相关的责任概不负责。Dell 对
'*** 该脚本不提供任何技术支持。有关 WMI
'*** 脚本的详情,请参阅适用的 Microsoft 说明文件。
'****************************************************
选项显式
'*** 声明变量
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim colInstances
Dim objInstance
Dim strWQLQuery
Dim strMessage
Dim strKeyName
'*** 确认使用了正确的可执行文件运行脚本
'*** 并且所有参数均已传递
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count<1)Then
CallUsage()
WScript.Quit
End If
'*** 初始化变量
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_SystemSummary"
strKeyName = "Name"
'*** WQL 查询检索 Dell_SystemSummary 的实例
strWQLQuery = "SELECT * FROM " & strClassName & " WHERE " & _
strKeyName&"="&Chr(34)&strComputerName&Chr(34)
'*** 检索 Dell_Configuration 类的实例(只能
'*** 有 1 个实例)。










