Users Guide

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
('****************************************************
'*** Nombre: SampleSystemSummary.vbs
'***Objetivo:mostrarlaetiquetadepropiedad,laetiquetadeservicioylarevisióndelBIOSde
'*** un cliente Dell OMCI.
'*** Uso: cscript.exe //nologo SampleSystemSummary.vbs <nombre_del_sistema>
'***
'***Estasecuenciadecomandosdemuestraseproporcionaúnicamentecomoejemplo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 colInstances
Dim objInstance
Dim strWQLQuery
Dim strMessage
Dim strKeyName
'***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_SystemSummary"
strKeyName = "Name"
'*** Consulta WQL para recuperar instancias de Dell_SystemSummary
strWQLQuery = "SELECT * FROM " & strClassName & " WHERE " & _
strKeyName&"="&Chr(34)&strComputerName&Chr(34)
'*** Recuperar las instancias de la clase Dell_Configuration (debe haber solo
'*** 1 instancia).
Set colInstances = GetObject("WinMgmts:{impersonationLevel=impersonate}//"&_
strComputerName&"/"&strNameSpace).ExecQuery(strWQLQuery,"WQL",
NULL)
'***Usarsolo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="Etiquetadepropiedad:"
strMessage=strMessage&objInstance.Properties_.Item
("AssetTag").Value
strMessage=strMessage&vbCRLF&"Etiquetadeservicio:"
strMessage=strMessage&objInstance.Properties_.Item
("ServiceTag").Value
strMessage=strMessage&vbCRLF&"VersióndelBIOS:"
strMessage=strMessage&objInstance.Properties_.Item
("BIOSVersion").Value
ExitFor
Siguiente
'*** Mostrar los resultados
WScript.Echo strMessage
'*** 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SampleSystemSummary.vbs<nombre_del_sistema>"
WScript.Echo strMessage
End Sub)