View Single Post
Old 12-28-2007   #1 (permalink)
IT Staff


 
 

Grouping by patches using powergadget

foreach ($computer in $computernames)
{
foreach ($kb in $patches)
{
$checkkb = Get-WmiObject Win32_QuickFixEngineering -computer $computer |
where-object {$_.hotfixid -eq $kb}

if ($checkkb)
{write-host $kb "(found)" "`r"}
else
{write-host -f red $kb "(Not found)" "`r"}
}
===================================================================================
the code works fine. i want to group by patches and count the machine that
has the patch, and count computers that has no patch. (for each patch in the
loop). How shld i approach the problem ?

Once i group them , i will pipe out to powergadget




My System SpecsSystem Spec