I’m looking for a way to also output any failures. The below script currently gets me the updates, HotFixID, installdate, and if the server is pending reboot.
$Results = Get-CimInstance -ClassName Win32_QuickFixEngineering -ComputerName $computers | where { $_.InstalledOn -gt (get-date).AddDays(-30) }
$Results | Select-Object -Property @{ Name = "Computer"; Expression = { $_.PSComputerName } }, Description, HotFixID, InstalledOn, @{
Name = 'RebootPending'; Expression = {
('No', 'Yes')[(Get-PendingReboot $_.PSComputerName | Select-Object -ExpandProperty RebootPending)]
}
} | sort @{ Expression = "RebootPending'"; Descending = $true }, Server | Out-GridView -Wait
Write-Host "Complete"
}