Now Available:

Featured Resources:

Newsletter

Email Address:

Subscribe





Ask the Expert

Have a question for our resident expert? .

Realtime Communities

« Another Off-Cycle Microsoft Patch Coming -- This Time its DNS... | Main | Tuesday "Just for Fun": Hasselhoff, eat your heart out... »

Hacking WSUS #2 of 5 -- Create Missing Patches Report

Aha! Knowing the patches installed on your computers is only so useful. Its great for handing to auditors. But what should really interest you is a report that will show you what patches are not installed on a particular computer.

What's interesting about this report is how it determines which patches are and are not installed. If the computer you scan is connected to a local WSUS server for its patches, it will compare itself against the patches set to "Install" on that WSUS server. If, however, this computer is not attached to a WSUS server, it will do the comparison against update.microsoft.com, and assume all patches there are considered approved.

Like with yesterday's script, you'll need to create a text file with a list of computer names -- one per line -- and reference that file when you run the script. An example: wsusDetectNotInstalled.vbs computers.txt.

Click the link below for the code:

strComputerList = WScript.Arguments.Item(0)

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(strComputerList, 1, True)
Set objTextFile = fso.OpenTextFile("OUTPUT.csv", 2, True)
objTextFile.WriteLine("Computer Name,Update Title")

Do While f.AtEndOfLine <> True
 strComputer = f.ReadLine

 Set objSession = CreateObject("Microsoft.Update.Session", strComputer)
 Set objSearcher = objSession.CreateUpdateSearcher()
 Set objResults = objSearcher.Search("Type='Software'")
 Set colUpdates = objResults.Updates

 For i = 0 to colUpdates.Count - 1
  If colUpdates.Item(i).IsInstalled = FALSE Then
   objTextFile.WriteLine(strComputer & "," & colUpdates.Item(i).Title)
  End If
 Next
Loop

WScript.Echo "Done!"

TrackBack

TrackBack URL for this entry:
https://realtime-windowsserver.com/type/mt-tb.cgi/89

Most Active Posts

Recent Posts

Greg Shields' Bio:

Greg Shields is a Principal Consultant with 3t Systems in Denver, Colorado. With more than 10 years of experience in information technology, Greg has developed extensive experience in systems administration, engineering, and architecture specializing in Microsoft, Citrix, and VMware technologies. Greg is a Contributing Editor for both Redmond Magazine and Microsoft Certified Professional Magazine, authoring two regular columns along with numerous feature articles, webcasts, and white papers. He is known for his abilities to relate highly technical concepts with a drive towards fulfilling business needs. Greg is also a highly sought-after instructor and speaker, teaching system and network troubleshooting curriculum for TechMentor Events, a twice-annual IT conference, and producing computer-based training curriculum for CBT Nuggets on numerous topics. Greg is a triple Microsoft Certified Systems Engineer (MCSE) with security specialization and a Certified Citrix Enterprise Administrator (CCEA).