Users Guide

'***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.)
'**********************************************************************
Option Explicit
'***Declarevariables(Variablesdedeclaración)
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
'***
'***(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)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count<1)Then
CallUsage()
WScript.Quit
End If
'***Initializevariables(Variablesdeinicialización)
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_SystemSummary"
strKeyName = "Name"
'*** WQL Query to retrieve instances of Dell_SystemSummary
'***
'*** (Consulta de WQL para recuperar instancias del resumen
'*** del sistema 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).
'***
'***(Recuperalasinstanciasdeclasedeconfiguración
'***Dell_Configuration(debeexistirsólo1instancia).)
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
'***
'***(Usasólolaprimerainstanciapararecuperarlaetiquetadepropiedad,
'***laetiquetadeservicioylaversióndelBIOS)
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 (Muestra los resultados)
WScript.Echo strMessage
'*** Sub used to display the correct usage of the script
'***
'*** (Subrutina para mostrar el uso correcto de la secuencia de comandos)
Sub Usage()
Dim strMessage
strMessage = "incorrect syntax. You should run: " & vbCRLF & _
"cscript.exe//nologoSampleSystemSummary.vbs<systemname>"
WScript.Echo strMessage
End Sub
CambiodecontraseñadelBIOS