Listing Windows Updates

by Sep 29, 2011

There is a not widely known COM object that you can use to list all the installed Windows Updates on a machine. Here is the code:

$Session = New-Object -ComObject Microsoft.Update.Session
$Searcher = $Session.CreateUpdateSearcher()
$HistoryCount = $Searcher.GetTotalHistoryCount()
$Searcher.QueryHistory(1,$HistoryCount) | 
  Select-Object Date, Title, Description

Twitter This Tip!
ReTweet this Tip!