vbscript CD-英特尔-SA-00075v3-DET
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vbscript CD-英特尔-SA-00075v3-DET相关的知识,希望对你有一定的参考价值。
Option Explicit
main()
Sub main
Log "Checking if this is a HP machine..."
If HPMachineDetect() = False Then
log "Checking if this is a HP machine Failed!"
Report False, "", "This client is not a HP machine.", ""
Exit Sub
Else
log "Checking if this is a HP machine was Successful!"
End If
Log "Checking the Model Number..."
If HPModelDetect() = False Then
log "Checking the Model number Failed!"
Report False, "", "Can not determine the machine model.", ""
Exit Sub
Else
log "Check the model number was Successful!"
End If
Log "Downloading the Intel Detection Tool Intel-SA-00075-console_1.0.2.116.exe..."
If FileDownload("Intel-SA-00075-console_1.0.2.116.exe") = False Then
log "Downloading the Intel Detection Tool Intel-SA-00075-console_1.0.2.116.exe Failed!"
Report True, "", "Could not download the Intel Detection Tool.", ""
Exit Sub
Else
log "Downloading the Intel Detection Tool Intel-SA-00075-console_1.0.2.116.exe was Successful!"
End If
Log "Running the Intel Detection Tool..."
If RunProgram("Intel-SA-00075-console_1.0.2.116.exe") = False Then
Log "Running the Intel Detection Tool Failed!"
Report True, "", "Running the Intel Detection Tool Failed!", ""
Exit Sub
Else
log "Running the Intel Detection Tool was Successful!"
End If
Dim strExpected
strExpected = "10.0.55.3000"
Const HKLM = &H80000002
Dim strComputer
strComputer = "."
Dim objReg
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
Dim strKeyPath
strKeyPath = "SOFTWARE\WOW6432Node\Intel\Setup and Configuration Software\INTEL-SA-00075 Discovery Tool\ME Information"
Dim strValueName
strValueName = "ME Version"
Dim strFound
objReg.GetStringValue HKLM,strKeyPath,strValueName,strFound
If err.Number <> 0 Then strFound = ""
Log "Expected: " & strExpected
Log "Found: " & strFound
If strFound = "" Or strFound = "Unknown" Then
Log "Intel Me Firmware Version: " & strFound
Log "Intel ME Firmware Version was not found."
Report False, strExpected, "Intel ME Firmware Version was not found.", strFound
Exit Sub
ElseIf strFound >= strExpected Then
Log "Intel Me Firmware Version: " & strFound
Log "Intel ME Firmware Version is up to date."
Report False, strExpected, "Intel ME Firmware Version is up to date.", strFound
Exit Sub
ElseIf strFound < strExpected Then
Log "Intel Me Firmware Version: " & strFound
Log "Intel ME Firmware Version is not up to date."
Report True, strExpected, "Intel ME Firmware Version is not up to date.", strFound
End If
End Sub
'-------------------------------------------------
'Get the System Manufacturer
Function HPMachineDetect()
Dim strComputer
Dim colSettings
Dim objWMIService
Dim objComputer
Dim strManufacturer
HPMachineDetect = false
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
strManufacturer = objComputer.Manufacturer
If Instr(LCase(strManufacturer), "hp") OR Instr(LCase(strManufacturer), "hewlett-packard") Then
log "System Manufacturer: " & strManufacturer
HPMachineDetect = true
End If
Next
End Function
'-------------------------------------------------
'Get the System Model
Function HPModelDetect()
Dim strComputer
Dim objWMIService
Dim colSettings
Dim objComputer
Dim strModel
HPModelDetect = False
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
For Each objComputer in colSettings
strModel = objComputer.Model
If Not strModel = "" Then
log "System Model: " & strModel
HPModelDetect = True
End If
Next
End Function
'-------------------------------------------------
'Download the program file from ldlogon
Function FileDownload(filename)
Log "The name of the file to download is: " & filename
FileDownload = False
Dim strHash
Dim strPath
Dim strLocalhash
Dim strHttpsource
Dim intStatus
strHash = GetFileHashCore(filename)
Log "Core Hash = " & strHash
strPath = GetWorkPath() & filename
Log "Working Path = " & strPath
strLocalhash = GetFileHashLocal(strPath)
Log "Local Hash = " & strLocalhash
strHttpsource = "http://" & GetCoreName() & "/ldlogon/" & filename
If strLocalhash = strHash Then
Log "The file is already in the LDClient directory."
FileDownload = True
Else
intStatus = Downloadfile(strHttpsource, strPath, strHash)
strHash = GetFileHashCore(filename)
strLocalhash = GetFileHashLocal(strPath)
If strLocalhash = strHash Then
Log "The file downloaded sucessfully."
FileDownload = True
End If
End If
End Function
'-------------------------------------------------
'Run the program
Function RunProgram(filename)
RunProgram = False
Dim strPath
strPath = GetWorkPath()
Dim strCmd
strCmd = filename & " -noconsole"
Log "Command to run: " & strCmd
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.CurrentDirectory = strPath
Log "Current Directory: " & strPath
Dim intReturn
intReturn = objShell.Run(strCmd, 0, True)
Log "Return Code: " & intReturn
If intReturn = 0 Or intReturn = 2 Or intReturn = 5 Or intReturn = 30 _
Or intReturn = 39 Or intReturn = 83 Or intReturn = 111 Or intReturn = 500 _
Or intReturn = 501 Or intReturn = 502 Or intReturn = 503 Or intReturn = 504 _
Or intReturn = 505 Or intReturn = 506 Then
RunProgram = True
End If
End Function
'-------------------------------------------------
'Get the name of the Core this device reports to
Function GetCoreName
Const strKeyPath = "\Software\Intel\LANDesk\LDWM"
Const strValueName = "\CoreServer"
Dim wshShell
Dim strValue
Set wshShell = CreateObject( "WScript.Shell" )
GetCoreName = wshShell.RegRead("HKLM" & strKeyPath & strValueName)
Log "Core Name: " & GetCoreName
End Function
'-------------------------------------------------
'Get the directory where LANDesk is installed
Function GetWorkPath()
Const strKeyPath = "\Software\LANDesk\ManagementSuite\WinClient"
Const strValueName = "\Path"
Dim wshShell
Dim strValue
Set wshShell = CreateObject( "WScript.Shell" )
strValue = wshShell.RegRead("HKLM" & strKeyPath & strValueName)
GetWorkPath = strValue & "\"
Log "Working Path: " & GetWorkPath
End Function
以上是关于vbscript CD-英特尔-SA-00075v3-DET的主要内容,如果未能解决你的问题,请参考以下文章