Any one have any ideas on how to identify reliably which microsoft patches are installed. I am using the following code but have found it unreliable.
Dim objWMIService, objSystem
IPaddress = inputbox("Enter IPAddress"
Call pingcheck(ipaddress)
Function pingcheck(IPAddress)
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}"
.ExecQuery("select * from Win32_PingStatus where address = '" & IPAddress & "'"
For Each objStatus In objPing
If IsNull(objStatus.StatusCode) Or objStatus.StatusCode<>0 Then
Else
Call getinfo(IPAddress)
End If
Next
End Function
Function GetInfo(IPAddress)
On Error Resume Next
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,AuthenticationLevel=pktprivacy}\\" & IPAddress & "\root\cimv2"
If Err.Number = 0 Then
'User
Set ColSystem=objWMIService.execquery ("Select * from Win32_QuickFixEngineering"
For Each objSystem In colSystem
messg = messg & objsystem.HotFixID & " - " & objsystem.caption & " - " & objsystem.description & " - " & objsystem.fixcomments & vbCrlf
Next
Else
msgbox err.description
Err.clear
End If
msgbox messg
End Function
Dim objWMIService, objSystem
IPaddress = inputbox("Enter IPAddress"
Call pingcheck(ipaddress)
Function pingcheck(IPAddress)
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}"
For Each objStatus In objPing
If IsNull(objStatus.StatusCode) Or objStatus.StatusCode<>0 Then
Else
Call getinfo(IPAddress)
End If
Next
End Function
Function GetInfo(IPAddress)
On Error Resume Next
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate,AuthenticationLevel=pktprivacy}\\" & IPAddress & "\root\cimv2"
If Err.Number = 0 Then
'User
Set ColSystem=objWMIService.execquery ("Select * from Win32_QuickFixEngineering"
For Each objSystem In colSystem
messg = messg & objsystem.HotFixID & " - " & objsystem.caption & " - " & objsystem.description & " - " & objsystem.fixcomments & vbCrlf
Next
Else
msgbox err.description
Err.clear
End If
msgbox messg
End Function