Hi
VBScript/WMI example to see if KB828035 is installed:
Const HKLM = &H80000002
sComputer = "name or IP address" ' use "." for local computer
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& sComputer & "\root\default:StdRegProv")
sKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\KB828035"
sValueName = "Installed"
iRC = oReg.GetDWORDValue(HKLM, sKeyPath, sValueName, sValue)
If iRC = 0 Then
If sValue = 1 Then
WScript.Echo "KB828035 is installed"
End If
End If
--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter
It works,thanks!
What if I need to check the same patch on several servers
(probably read the list of servers through a notepad) and
then output the results to excel spreadsheet?
Tl
> Early morning brain deadness on my behalf.... what is the syntax to loop
> through the hotfix keys and display what hotfixes are installed...
> Thanks in advance..
Hi
Enumerate Subkeys
http://www.microsoft.com/technet/scriptcenter/registry/scrreg09.asp
> What if I need to check the same patch on several servers
> (probably read the list of servers through a notepad) and
> then output the results to excel spreadsheet?
Hi
Yes, you can read the server names from a text file (you could also ping them
first to see if they are online before trying to connect with WMI).
The result I would have saved to a CSV file (Excel reads CSV files very nicely
to create a spreadsheet). Create a file with extension .csv and write a new
line for each server with the status, e.g. like this:
Server1,Patched
Server2,Could not connect
Server3,Not patched
To read computer names from a text file, here is a simple example:
http://groups.google.com/groups?selm=3F4BB6CE.289BB749%40hydro.com
Here is a example on writing to a log file (e.g. a CSV file), as well as
pinging computers to see if they are online:
http://dev.remotenetworktechnology.com/wsh/tb/remoteinstallwmi.htm
--