Users Guide

'**********************************************************************
'*** 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>"
'***
'*** (Nombre: SampleBIOSPwd.vbs
'***Objetivo:CambiarlacontraseñadelBIOSenunclienteDellOMCI.
'*** Uso: cscript.exe //nologo SampleBIOSPwd.vbs <nombre del sistema>
'***"<contraseñaanterior>space<contraseñanueva>")
'***
'*** 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.
'***
'*** (Esta secuencia de comandos de muestra se proporciona como
'***ejemplosolamenteynohasidoprobada,niestágarantizada
'*** de ninguna manera por Dell; Dell rechaza cualquier responsabilidad
'***relacionadaconésta.Dellnoproporcionaasistenciatécnicacon
'***respectoaestetipodesecuenciasdecomandos.Paraobtenermás
'***informaciónsobrelassecuenciasdecomandosdeWMI,consultela
'***documentacióndeMicrosoftsobreeltema.)
'**********************************************************************
'***Declarevariables(Variablesdedeclaración)
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
'***
'***(Verifiquequeseusóelarchivoejecutablecorrectoparaejecutar
'***lasecuenciadecomandosyquetodoslosparámetrospasaron)
If (LCase(Right(WScript.FullName, 11)) <> "cscript.exe" ) Or _
(Wscript.Arguments.Count<2)Then
CallUsage()
WScript.Quit
End If
'***Initializevariables(Variablesdeinicialización)
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_Configuration"
strKeyValue = "Configuration"
strPropName = "Password"
strPassEncryptPropName = "PasswordEncrypted"
strPwd = WScript.Arguments(1)
'*** Retrieve the instance of Dell_Configuration class (there should
'*** only be 1 instance).
'***
'***(Recuperalainstanciadelaclasedeconfiguración
'***Dell_Configurationclass(debeexistirsólo1instancia).)
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
'***
'*** (Establezca el nuevo valor para la propiedad y guarde la instancia)
objInstance.Properties_.Item(strPropName).Value = strPwd
objInstance.Properties_.Item(strPassEncryptPropName).Value = 0
objInstance.Put_
'*** If any errors occurred, let the user know
'***
'***(Avisaalusuariosiocurrealgúnerror)
If Err.Number <> 0 Then
WScript.Echo"SettingtheBIOSpasswordfailed."
End If
'*** Sub used to display the correct usage of the script
'***
'*** (Subrutina utilizada para mostrar el uso correcto de
'*** la secuencia de comandos)
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