PowerShell - Get Last Updates applied on list of servers/computers
- Jon Boyette
- Jan 10, 2022
- 1 min read
Save this as a .ps1, add servers to check to c:\temp\servers.txt, Outputs HotFixreport.txt to the desktop.
function Hotfixreport {
$computers = Get-Content C:\temp\servers.txt
$ErrorActionPreference = 'Stop'
ForEach ($computer in $computers) {
try
{
Get-HotFix -cn $computer | Select-Object PSComputerName,HotFixID,Description,InstalledBy,InstalledOn | FT -AutoSize
}
catch
{
Write-Warning "System Not reachable:$computer"
}
}
}
Hotfixreport > "$env:USERPROFILE\Desktop\Hotfixreport.txt"
Comments