Pending reboot detection across Windows servers
A read-only pending reboot check for Windows servers before patching, application installs, or maintenance-window closure.
Good For
- patch readiness
- maintenance windows
- post-update validation
- server handoff
- reboot planning
How to Use It
- Run the check before a patch window to identify hosts that already need a restart.
- If Component Based Servicing is pending, review recent Windows servicing or feature installation activity.
- If Windows Update is pending, compare with the patch deployment tool and maintenance-window schedule.
- If pending file rename operations are present, review recent driver, antivirus, backup-agent, or application installs.
- After an approved reboot, run the same check again and record which signals cleared.
- Keep exceptions documented when a host cannot reboot because of application freeze, replication, or business-window constraints.
Execution Modes
- local
- remote-single-host
- remote-host-list
- ad-filtered
Inputs and Outputs
Inputs
- computer name
- CSV or TXT server list
- Active Directory server scope
- PowerShell remoting access
- maintenance-window notes
Outputs
- verbose-console
- csv
- future-html-report
Command Starter
Safe to run: read-only
$ComputerName = "server01"
Invoke-Command -ComputerName $ComputerName -ScriptBlock { $paths = @("HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending", "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired", "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager"); [pscustomobject]@{ ComputerName = $env:COMPUTERNAME; ComponentBasedServicing = Test-Path $paths[0]; WindowsUpdate = Test-Path $paths[1]; PendingFileRename = [bool](Get-ItemProperty -Path $paths[2] -Name PendingFileRenameOperations -ErrorAction SilentlyContinue) } }Validation
- Every checked server has a recorded true or false result for each pending reboot signal.
- Approved reboots clear the expected pending signals after the host returns.
- Servers that remain pending have a documented owner, reason, and next maintenance window.
Reporting
- export multi-server results to CSV for the patch window record
- include uncleared pending reboot signals in handoff notes
- promote repeated use into a patch-readiness report pack with owner and exception columns
Safety Notes
- This check reports reboot state only; it does not restart servers.
- Do not schedule or force reboots from this evidence pass without change approval and application-owner confirmation.