Created the below for a requirement installed check in CM 2012, based on the script here:
http://desktopdeploy.wordpress.com/2010/04/26/vbscript-list-ms-hotfixes-installed/
Option Explicit
On Error Resume Next
Dim strComputer, objWMIService, colQuickFixes, objQuickFix, HFInstalled, HFID
strComputer = "."
HFID = "KB958830"
HFInstalled = False
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery ("Select * from Win32_QuickFixEngineering")
For Each objQuickFix in colQuickFixes
If objQuickFix.HotFixID = HFID Then
HFInstalled = True
Exit For
End If
Next
If HFInstalled = True Then
wScript.Quit 0
Else
wScript.Quit 1
End If
No comments:
Post a Comment