SRV Curated SOP / Servers
Check pending Windows updates and the last install date on a Windows Server
Find out when a Windows Server last installed an update, which updates it still needs, and whether it is waiting for a restart to finish installing.
Written and maintained by MSP Stockroom. Nobody else edits it.
On this page
Before you run anything: read every command first and understand what it does. Replace example names, domains and addresses with your own. Try it on a test device or tenant before a client's. Keep client names, passwords and keys out of tickets and chat.
Purpose
Find out when a Windows Server last installed an update, which updates it still needs, and whether it is waiting for a restart to finish installing. Use it when you take over a client's servers, when a server misses its patch window, and before you plan a maintenance restart. Read-only: nothing in this SOP changes the server.
Scope and prerequisites
- Run by the tech supporting the server, in a PowerShell window on that server or through your remote management tool.
- Microsoft documents the update search objects used in step 2 as available to standard users as well as administrators.
- Do not use the download or install parts of the Windows Update interfaces. Installing updates is a separate change with its own window.
Steps
- List the five most recent installed updates, newest last:
Get-HotFix | Sort-Object -Property InstalledOn | Select-Object -Last 5 HotFixID, Description, InstalledBy, InstalledOnRead the result:
- The last row's InstalledOn is the most recent install date that Windows records this way. Compare it with the client's patch schedule.
- Get-HotFix only shows updates installed by the component servicing system. Updates installed by an MSI or from the Windows Update site do not appear, so treat this as a guide, not a full history.
- Search for updates that are not yet installed. The search asks the update source the server is set to use, such as Windows Update or the client's WSUS server, and can take a few minutes:
$session = New-Object -ComObject Microsoft.Update.Session $searcher = $session.CreateUpdateSearcher() $result = $searcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0") $result.Updates | Select-Object Title, MsrcSeverity, IsDownloaded, IsMandatory, LastDeploymentChangeTimeRead the result:
- No rows: the update source offers nothing more for this server right now.
- MsrcSeverity Critical or Important: record these first.
- IsDownloaded True: the update is downloaded and waiting to install.
- LastDeploymentChangeTime: when the update was published or last changed. An old date on a pending security update means the server has fallen behind.
- Check whether the server is waiting for a restart to finish installing updates:
(New-Object -ComObject Microsoft.Update.SystemInfo).RebootRequiredRead the result:
- True: a restart is needed to finish installing updates. Record it, and agree a time with the client.
- False: no restart is pending for updates.
Verify
You have the last install date, a list of pending updates with their severity, and the restart state, recorded against the server name. A server with pending Critical or Important updates, or a last install date outside the client's patch schedule, goes to the client contact as a finding.
Rollback
Nothing to roll back; this SOP only reads. Installing updates, restarting the server or changing its update source are separate changes, made with the client's approval.
Notes
If the server uses WSUS, the pending list shows only what WSUS offers it, which may not be everything Microsoft has released. Check the WSUS approvals if the list looks short. The update search can use more memory than usual while it runs, so avoid running it on a busy server at peak times. Get-HotFix output can differ between Windows versions. See https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-hotfix and https://learn.microsoft.com/windows/win32/api/wuapi/nf-wuapi-iupdatesearcher-search for Microsoft's documentation.
Sources and notes
- https://learn.microsoft.com/powershell/module/microsoft.powershell.management/get-hotfix
- https://learn.microsoft.com/windows/win32/api/wuapi/nf-wuapi-iupdatesearcher-search
Curated SOP from the MSP Stockroom SOP library (curated/servers/check-pending-windows-updates-and-last-install-date.md). Last reviewed December 1, 2026. Tested on: Not yet run; written for Windows Server 2022, Windows Server 2019; Windows PowerShell 5.1. Vendor screens and commands change; check the vendor documentation before you rely on a step. Found a mistake? See corrections.