Users Guide

'***Estasecuenciadecomandosdeejemploseproporcionaúnicamentecomomuestraynohasido
'***probabanitieneningunagarantíaporpartedeDell;Dellseeximedetoda
'*** responsabilidad relacionada con esta secuencia de comandos. Dell no proporciona asistencia
'***técnicarelacionadaconestetipodesecuenciasdecomandos.Paraobtenermásinformaciónsobresecuencias
'***decomandosdeWMI,consulteladocumentacióncorrespondientedeMicrosoft.
'****************************************************
Opciónexplícita
'*** Declarar variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim strPropValue
Dim objInstance
Dim ObjOutParam
Dim strMethod
'***Comprobarqueseutilizóelarchivoejecutablecorrectoparaejecutarlasecuenciadecomandos
'***yqueseproporcionarontodoslosparámetros
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count<1)Then
CallUsage()
WScript.Quit
End If
'*** Inicializar las variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_Configuration"
strPropValue = "Configuration"
strMethod = "Restart"
'*** Recuperar la clase Dell_Configuration
Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate}//" &_
strComputerName&"/"&strNameSpace&":"&strClassName)
'***EjecutarelmétodoShutdown(apagado)
Set ObjOutParam = objInstance.ExecMethod_(strMethod)
'***Informaralusuariosielmétodoseejecutósatisfactoriamente
'*** Nota: si el valor generado es 0, no significa que el sistema se ha
'***apagado,sinoqueseiniciócorrectamenteelmétodo
'*** correctamente.
If objOutParam.ReturnValue = 0 Then
WScript.Echo"Elmétodoterminócorrectamente."
else
WScript.Echo"Elmétodofalló."
End If
'*** Subrutina que se utiliza para mostrar el uso correcto de la secuencia de comandos
Sub Usage()
Dim strMessage
strMessage = "Sintaxis incorrecta. Debe ejecutar: " & vbCRLF & _
"cscript.exe//nologoSampleRestart.vbs<nombre_del_sistema>"
WScript.Echo strMessage
End Sub)
ActualizaciónremotadelBIOS
AcontinuaciónsepresentaunVBScriptdeejemploqueactualizaráelBIOSdeunclienteDellOMCIdemaneraremota.
'****************************************************
'*** 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