Users Guide

Dim strClassName
Dim strKeyValue
Dim objInstance
Dim strPropName
Dim strPropValue
'*** 确认使用了正确的可执行文件运行脚本
'*** 并且所有参数均已传递
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count<1)Then
CallUsage()
WScript.Quit
End If
'*** 初始化变量
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_SMBIOSSettings"
strKeyValue = "0"
strPropName = "WakeupOnLan"
'*** 检索 Dell_SMBIOSSettings 类的实例(只能
'*** 1 个实例)。
Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate}//" &_
strComputerName&"/"&strNameSpace&":"&strClassName&"="&_
Chr(34)&strKeyValue&Chr(34))
strPropValue = objInstance.Properties_.Item(strPropName).Value
'*** 只有当 WakeUpOnLan 不是"6""
'*** 所有 NIC 启用")时,才设置其值
if strPropValue <> 6 then
'***设置该属性的新值并保存实例
objInstance.Properties_.Item(strPropName).Value = 6
objInstance.Put_
'***如果出现任何错误,让用户知道
If Err.Number <> 0 Then
WScript.Echo"启用通过 LAN 唤醒失败。"
End If
End If
'*** Sub 用于显示脚本的正确用法
Sub Usage()
Dim strMessage
strMessage = "语法不正确。应运行:" & vbCRLF & _
"cscript.exe//nologoSampleWuOLEnable.vbs<系统名称>"
WScript.Echo strMessage
End Sub)
索服务标签资产标签BIOS 版本
下面是将显示 Dell OMCI 客户端的资产标签、服务标签和 BIOS 版本的示例 VBScript
'****************************************************
'*** Name: SampleSystemSummary.vbs
'*** Purpose: To display asset tag, service tag, and BIOS revision of
'*** a Dell OMCI client.
'*** Usage: cscript.exe //nologo SampleSystemSummary.vbs <systemname>
'***
'*** 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.
'****************************************************
Option Explicit
'*** Declare variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim colInstances
Dim objInstance
Dim strWQLQuery
Dim strMessage
Dim strKeyName
'*** Check that the right executable was used to run the script
'*** and that all parameters were passed
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count<1)Then
CallUsage()
WScript.Quit