Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Installed patches?

Status
Not open for further replies.

boostaz1

Programmer
Aug 26, 2003
7
0
0
US
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(&quot;winmgmts:{impersonationLevel=impersonate,AuthenticationLevel=pktprivacy}\\&quot; & IPAddress & &quot;\root\cimv2&quot;)
If Err.Number = 0 Then
'User
Set ColSystem=objWMIService.execquery (&quot;Select * from Win32_QuickFixEngineering&quot;)
For Each objSystem In colSystem
messg = messg & objsystem.HotFixID & &quot; - &quot; & objsystem.caption & &quot; - &quot; & objsystem.description & &quot; - &quot; & objsystem.fixcomments & vbCrlf
Next
Else
msgbox err.description
Err.clear

End If
msgbox messg

End Function
 
thread329-404371 a look at the above link, near the bottom is the code to check the currently installed patches. I sure you can adapt it for your needs

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top