# Add hotfixes to scan for $hotFixes = @( "KB973815", "KB3176935", "KB4019264", "KB3138901" ) # Add computers to scan for $computers = (get-content -path c:\reports\computers.txt) # Report name $Report = @() $reportName = "c:\setup\Report_$(get-date -Uformat "%Y%m%d-%H%M%S").csv" # return hotfix Function Get-HotFixStatus([string]$hotFixes, [string]$computers) { Get-WmiObject -class win32_QuickFixEngineering -Filter "HotFixID = '$hotfixes'" -computername $computers } # Output to screen - create report with true or false Function Get-HotFixReport([string[]]$hotFixes, [string[]]$computers) { foreach($computer in $computers) { Write-Host " " Write-Host $computer foreach ($hotfix in $hotfixes) { Write-Host $hotfix $status = $(if(Get-HotFixStatus -hotfix $hotfix -computer $computer) {$true} else {$false}) $object = New-Object -TypeName PSObject $object | Add-Member -MemberType NoteProperty -Name Computer -Value $computer $object | Add-Member -MemberType NoteProperty -Name HotFix -Value $hotfix $object | Add-Member -MemberType NoteProperty -Name Installed -Value $status Write-host "--" $status $object } } } Clear-Host Write-Host "Compiling report..." Get-HotFixReport -hotfix $hotfixes -computer $computers | Sort-object -property computer | Export-Csv $reportName -NoTypeInformation -UseCulture ii $reportName Write-Host " " Write-Host "Done!"
Screenshot