This is a quick method to log available updates for windows hosts.
Set updateSession = CreateObject(“Microsoft.Update.Session”)
Set updateSearcher = updateSession.CreateupdateSearcher()
Set searchResult = updateSearcher.Search(””)
wscript.echo searchResult.Updates.Count
You can now use wua.getnumupdates[] to monitor available updates for your monitored windows hosts.
Discussion
I had trouble getting this script to work. Try this:
Set updateSession = CreateObject(“Microsoft.Update.Session”) Set updateSearcher = updateSession.CreateupdateSearcher() Set searchResult = _ updateSearcher.Search(“IsInstalled=0 and Type='Software'”) WScript.Echo searchResult.Updates.Count
If you only want critical updates try changing this line: updateSearcher.Search(“IsAssigned=1 and IsHidden=0 and IsInstalled=0 and Type='Software'”)