To generate a report that lists the installed Windows Updates by date, use the below VBS script in conjunction with a text file (i.e. computers.txt) that references which Windows computers/servers you would like a report from.
First, create a file with .vbs extension using below 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,Date,Update Title")
Do While f.AtEndOfLine <> True
strComputer = f.ReadLine
Set objSession = CreateObject("Microsoft.Update.Session", strComputer)
Set objSearcher = objSession.CreateUpdateSearcher()
intHistoryCount = objSearcher.GetTotalHistoryCount
Set colHistory = objSearcher.QueryHistory(0, intHistoryCount)
For Each objHistory in colHistory
objTextFile.WriteLine(strComputer & "," & objHistory.Date & "," & Replace(objHistory.Title, ",", ""))
Next
Loop
WScript.Echo "Done!"
Then make a text file with your list of Windows computers/servers, each on a new line, that you would like the report to gather info from.
Finally, run the command. Command prompt usage example: wsus-detect.vbs computers.txt
After running the script it will generate the OUTPUT.csv file which can be viewed and manipulated as a spreadsheet.
(via Realtime Windows Server)
