I'm truly struggling today;
Feeder file with list of servers
Prompt for KB<numeric>
Checks whether HFB has been applied and reports installer and date details and then exports to simple CSV.
It's pretty much a simple one-liner but I'm going around in circles with the export!
Currently
OK, so this dumps out what I need, however I would like to include rows where the patch isn't installed and also where the server is unavailable/non-reportable.
Cheers, Paul.
Feeder file with list of servers
Prompt for KB<numeric>
Checks whether HFB has been applied and reports installer and date details and then exports to simple CSV.
It's pretty much a simple one-liner but I'm going around in circles with the export!
Currently
Code:
Clear-Host
$Machines = "C:\windows\servers.txt"
$Patch = "KB2922229";
#$Patch;Read-Host 'KB<numeric<>'
$Computers = Get-Content $Machines
$temp = $null
ForEach ($Item in $Computers)
{
$temp +=,(Get-Hotfix $Patch -ComputerName $Item | Select PSComputerName, HotfixID, Description, InstalledBy, InstalledOn | sort InstalledOn)
}
$path = $temp | Export-Csv 'c:\output.csv'
OK, so this dumps out what I need, however I would like to include rows where the patch isn't installed and also where the server is unavailable/non-reportable.
Cheers, Paul.
Last edited: