Quick way to monitor Windows Updates
Posted: Thu Aug 06, 2015 2:36 pm
Hello there, I seem to be having some trouble with scripting a way to check windows updates quickly. First of all, I have pretty much tried every script on the exchange and for some reason or another, it is not what I want.
I'm basically just need a script that checks the number of critical updates available and compare and it warning and critical values. The problem is every script that I have tried that works is very very very slow.
Most of the powershell scripts on the exchange that I've tried use something along the lines of
"$UpdateSession = New-Object -ComObject Microsoft.Update.Session
$UpdateSearcher = $UpdateSession.CreateUpdateSearcher()
$SearchResult = $UpdateSearcher.Search("IsHidden=0 and IsInstalled=0")
#Matrix Results for type of updates that are needed
$Critical = $SearchResult.updates | where { $_.MsrcSeverity -eq "Critical" }
"
Calling microsoft.update.session is really slow on the servers I need monitored, each check takes over 15 minutes.
The only other method I've seen to query updates is to look in either
C:\Windows\WindowsUpdates.log
or
C:\Windows\SoftwareDistribution\ReportingEvents.log
and although they both have information of pending updates (retrieved from previous update query), there is no way to distinguish how many updates are actually critical .
If any of you have any feedback, it would be greatly appreciated.
I'm basically just need a script that checks the number of critical updates available and compare and it warning and critical values. The problem is every script that I have tried that works is very very very slow.
Most of the powershell scripts on the exchange that I've tried use something along the lines of
"$UpdateSession = New-Object -ComObject Microsoft.Update.Session
$UpdateSearcher = $UpdateSession.CreateUpdateSearcher()
$SearchResult = $UpdateSearcher.Search("IsHidden=0 and IsInstalled=0")
#Matrix Results for type of updates that are needed
$Critical = $SearchResult.updates | where { $_.MsrcSeverity -eq "Critical" }
"
Calling microsoft.update.session is really slow on the servers I need monitored, each check takes over 15 minutes.
The only other method I've seen to query updates is to look in either
C:\Windows\WindowsUpdates.log
or
C:\Windows\SoftwareDistribution\ReportingEvents.log
and although they both have information of pending updates (retrieved from previous update query), there is no way to distinguish how many updates are actually critical .
If any of you have any feedback, it would be greatly appreciated.