const statusAlive = "scriptRes:Host is alive:" const statusDead = "scriptRes:No answer:" const statusUnknown = "scriptRes:Unknown:" const statusNotResolved = "scriptRes:Unknown host:" const statusOk = "scriptRes:Ok:" const statusBad = "scriptRes:Bad:" const statusBadContents = "scriptRes:Bad contents:" ' check this category for 'High Priority' updates category = "UpdateClassification" highpriority = ",Security Updates,Update Rollups,Critical Updates," ' create instance of update.searcher (offline) Set objSearcher = CreateObject("Microsoft.Update.Searcher") objSearcher.Online = 1 ' find and fetch collection of updates Set objResults = objSearcher.Search("Type='Software' and IsInstalled=0") Set colUpdates = objResults.Updates count = 0 For i = 0 to colUpdates.Count - 1 ' check categories Set colCategories = colUpdates.Item(i).Categories For c = 0 to colCategories.Count - 1 If colCategories.item(c).Type = category _ And InStr(highPriority, "," & colCategories.item(c).Name & ",") > 0 Then count = count + 1 End If Next Next 'send results to host monitor if count > 0 then WScript.StdOut.Write statusBad & count & " high priority updates found!" else WScript.StdOut.Write statusOk & "No new high priority updates found" End If