Users Guide

'*** 检索 Dell_Configuration
Set objClass = GetObject("WinMgmts:{impersonationLevel=impersonate}//" & _
strComputerName&"/"&strNameSpace&":"&strClassName)
Set objMethod = objClass.Methods_(strMethod)
'*** 将方法的 In 参数设置为 BIOS 标头文件的 URL
Set objInParam = objMethod.inParameters.SpawnInstance_()
objInParam.sUrl = WScript.Arguments(1)
'*** 执行方法
Set ObjOutParam = objClass.ExecMethod_(strMethod, objInParam)
'*** 让用户知道方法是否返回成功
'*** 注:如果返回值为 0,并不意味着系统的 BIOS
'*** 已刷写,而只是意味着已成功启动刷写
'*** 方法。
If objOutParam.ReturnValue = 0 Then
WScript.Echo"方法已成功完成。"
else
WScript.Echo"方法失败。"
End If
'*** Sub 用于显示脚本的正确用法
Sub Usage()
Dim strMessage
strMessage = "语法不正确。应运行:" & vbCRLF & _
"cscript.exe//nologoSampleFlash.vbs<系统名称>
<BIOS 标头文件的 URL>"
WScript.Echo strMessage
End Sub)
在下次重新启动时启PXE
下面是将强制 Dell OMCI 客户端在下次重新引导时引导 PXE 的示例 VBScript
'****************************************************
'*** Name: SampleForcePXE.vbs
'*** Purpose: To force a Dell OMCI client to boot to PXE on next reboot.
'*** Usage: cscript.exe //nologo SampleForcePXE.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 strKeyValue
Dim objInstance
Dim strPropName
Dim strPropValue
'*** 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
End If
'*** Initialize variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_Configuration"
strKeyValue = "Configuration"
strPropName = "ForcePXEOnNextBoot"
'*** 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))
strPropValue = objInstance.Properties_.Item(strPropName).Value
'*** Set the new value for the property and save the instance, but only
'*** if the current value is not already 3 ('Enabled')
If strPropValue <> 3 Then