'******************************************************************* '*** Name: SampleShutdown.vbs '*** Purpose: To shut down a Dell OMCI client. '*** Usage: cscript.exe //nologo SampleShutdown.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 strPropValue Dim objInstance Dim ObjOutParam Dim strMethod
'*** 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
'*** Retrieve the Dell_Configuration class Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate}//" &_ strComputerName & "/" & strNameSpace & ":" & strClassName)
'*** Execute the Shutdown method Set ObjOutParam = objInstance.ExecMethod_(strMethod)
'*** Let the user know whether the method returned success or not '*** Note: if return value is 0, it does not mean the system has '*** shutdown, it only means that the shutdown method was initiated '*** successfully. If objOutParam.ReturnValue = 0 Then WScript.Echo "Method completed successfully." else WScript.Echo "Method failed." End If
'*** Sub used to display the correct usage of the script Sub Usage() Dim strMessage strMessage = "incorrect syntax. You should run: " & vbCRLF & _ "cscript.exe //nologo SampleShutdown.vbs <systemname>" WScript.Echo strMessage End Sub
Remote System Restart
'********************************************************************** '*** Name: SampleRestart.vbs '*** Purpose: To restart a Dell OMCI client. '*** Usage: cscript.exe //nologo SampleRestart.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 strPropValue Dim objInstance Dim ObjOutParam Dim strMethod
'*** 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
'*** Retrieve the Dell_Configuration class Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate}//" &_ strComputerName & "/" & strNameSpace & ":" & strClassName)
'*** Execute the Shutdown method Set ObjOutParam = objInstance.ExecMethod_(strMethod)
'*** Let the user know whether the method returned success or not '*** Note: if return value is 0, it does not mean the system has '*** shutdown, it only means that the shutdown method was initiated '*** successfully. If objOutParam.ReturnValue = 0 Then WScript.Echo "Method completed successfully." else WScript.Echo "Method failed." End If
'*** Sub used to display the correct usage of the script Sub Usage() Dim strMessage strMessage = "incorrect syntax. You should run: " & vbCRLF & _ "cscript.exe //nologo SampleRestart.vbs <systemname>" WScript.Echo strMessage End Sub
Remote BIOS Update
'********************************************************************** '*** Name: SampleFlash.vbs '*** Purpose: To flash the BIOS of a Dell OMCI client. '*** Usage: cscript.exe //nologo SampleFlash.vbs <systemname> <URL '*** of BIOS header file> '*** '*** 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 strPropValue Dim objInstance Dim ObjOutParam Dim strMethod Dim objMethod Dim objClass Dim objInParam
'*** 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 < 2) Then Call Usage() WScript.Quit End If
'*** Retrieve the Dell_Configuration class Set objClass = GetObject("WinMgmts:{impersonationLevel=impersonate}//" & _ strComputerName & "/" & strNameSpace & ":" & strClassName)
Set objMethod = objClass.Methods_(strMethod)
'*** Set the In parameter of the method to the URL of BIOS header file Set objInParam = objMethod.inParameters.SpawnInstance_() objInParam.sUrl = WScript.Arguments(1)
'*** Execute the method Set ObjOutParam = objClass.ExecMethod_(strMethod, objInParam)
'*** Let the user know whether the method returned success or not '*** Note: if return value is 0, it does not mean the system's BIOS has '*** been flashed, it only means that the flash method was initiated '*** successfully. If objOutParam.ReturnValue = 0 Then WScript.Echo "Method completed successfully." else WScript.Echo "Method failed." End If
'*** Sub used to display the correct usage of the script Sub Usage() Dim strMessage strMessage = "incorrect syntax. You should run: " & vbCRLF & _ "cscript.exe //nologo SampleFlash.vbs <systemname> <URL of BIOS header file>" WScript.Echo strMessage End Sub
Enabling PXE Boot on the Next Reboot
'********************************************************************** '*** 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
'*** 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 objInstance.Properties_.Item(strPropName).Value = 3 objInstance.Put_
'*** If any errors occurred, let the user know If Err.Number <> 0 Then WScript.Echo "Setting PXE on next reboot failed." End If End If
'*** Sub used to display the correct usage of the script Sub Usage() Dim strMessage strMessage = "incorrect syntax. You should run: " & vbCRLF & _ "cscript.exe //nologo SampleForcePXE.vbs <systemname>" WScript.Echo strMessage End Sub
Enabling Wakeup on LAN
'********************************************************************** '*** Name: SampleWuOLEnable.vbs '*** Purpose: To enable Wakeup On LAN on a Dell OMCI client. '*** Usage: cscript.exe //nologo SampleWuOLEnable.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
'*** Set the value of WakeUpOnLan only if it is not already '6' ("Enable '*** for all NICs") if strPropValue <> 6 then
'*** Set the new value for the property and save the instance objInstance.Properties_.Item(strPropName).Value = 6 objInstance.Put_
'*** If any errors occurred, let the user know If Err.Number <> 0 Then WScript.Echo "Enabling WakeUp On Lan failed." End If End If
'*** Sub used to display the correct usage of the script Sub Usage() Dim strMessage strMessage = "incorrect syntax. You should run: " & vbCRLF & _ "cscript.exe //nologo SampleWuOLEnable.vbs <systemname>" WScript.Echo strMessage End Sub
Retrieving Service Tag, Asset Tag, and BIOS Revision
'********************************************************************** '*** 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 End If
'*** 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 = "Asset Tag: " strMessage = strMessage & objInstance.Properties_.Item ("AssetTag").Value strMessage = strMessage & vbCRLF & "Service Tag: " strMessage = strMessage & objInstance.Properties_.Item ("ServiceTag").Value strMessage = strMessage & vbCRLF & "BIOS Version: " strMessage = strMessage & objInstance.Properties_.Item ("BIOSVersion").Value Exit For 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 //nologo SampleSystemSummary.vbs <systemname>" WScript.Echo strMessage End Sub
Changing BIOS Password
'********************************************************************** '*** 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
'*** 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 WScript.Echo "Setting the BIOS password failed." End If
'*** Sub used to display the correct usage of the script Sub Usage() Dim strMessage strMessage = "Incorrect syntax. You should run: " & vbCRLF & _ "cscript.exe //nologo SampleBIOSPwd.vbs <systemname> " & Chr(34) & _ "<old pwd> space <new pwd>" & Chr(34) WScript.Echo strMessage End Sub
BIOS Tokens Supported in OMCI
The BIOS tokens supported in OMCI are:
ASFMode
AudioMode
AutoOn
AutoOnHour
AutoOnMinute
BootSequence
BuiltinFloppy
BuiltinNIC
BuiltinPointingDevice
ChassisIntrusion
ChassisIntrusionStatus
FastBoot
HotDocking
Hyperthreading
IDEController
IntegratedAudio
InternalMiniPCI
LowPowerS5
NoExecute
Onboard1394
ParallelPortConfiguration
ParallelPortMode
PCISlots
POSTF12KeySetting
POSTF2KeySetting
PowerManagementSettings
PrimaryParallelATAMaster
PrimaryParallelATASlave
PrimaryVideo
RadioTransmission
SecondaryParallelATAMaster
SecondaryParallelATASlave
SerialATAChannel1
SerialATAChannel2
SerialATAChannel3
SerialATAChannel4
SerialATAChannel5
SerialATAChannel6
SerialATAChannel7
SerialATAChannel8
SerialPort1Configuration
SerialPort2Configuration
SpeakerVolume
TertiaryParallelATAMaster
TertiaryParallelATASlave
USBEmulation
USBFrontPanelPorts
USBPorts
WakeupOnLAN
WakeupOnLANMethod
WirelessDevice
NOTE: Not all of the above listed BIOS tokens are supported on all Dell systems.