Experience the new look and feel.
Get your patch reporting under control with this FREE powershell script.
reportPatch.ps1
$erroractionpreference = "SilentlyContinue" clear-host $a = New-Object -comobject Excel.Application $a.visible = $True $b = $a.Workbooks.Add() $c = $b.Worksheets.Item(1) $c.Cells.Item(1,1) = "Machine Name" $c.Cells.Item(1,2) = "Patch KB" $d = $c.UsedRange $d.Interior.ColorIndex = 19 $d.Font.ColorIndex = 11 $d.Font.Bold = $True $intRow = 2 #if ($args.count -lt 1) #{ # write-host -f blue "Syntax Error : Must have 2 parameters." #write-host -f blue "Eg powershell.exe <path>\kb.ps1 <pathname of file>" #break #} $filename = "servers.txt" $kb = "kb956391" $computernames = get-content $filename foreach ($computer in $computernames) { $strQuery = "select * from win32_pingstatus where address = '" + $computer + "'" $wmi = get-wmiobject -query $strQuery if ($wmi.statuscode -eq 0) { $checkkb = get-wmiobject Win32_QuickFixEngineering -computer $computer | where-object {$_.hotfixid -eq $kb} | select-object hotfixid, description # BEGIN CALLOUT A if ($checkkb.hotfixid -eq $kb) { $c.Cells.Item($intRow,1) = $computer $c.Cells.Item($intRow,2) = $checkkb.description $c.Cells.Item($intRow,2).Interior.ColorIndex = 4 } else {$c.Cells.Item($intRow,1) = $computer $c.Cells.Item($intRow,2) = "Patch not found." } } else {$c.Cells.Item($intRow,1) = $computer $c.Cells.Item($intRow,2) = "Ping Failed." $c.Cells.Item($intRow,2).Interior.ColorIndex = 6 } $intRow = $intRow + 1 } $d.EntireColumn.AutoFit()