/
How To: Use PowerShell to Check Pending Reboot
How To: Use PowerShell to Check Pending Reboot
Overview
This document will cover using PowerShell to check for any pending reboots.
Prerequisites
Administrator access to Windows PowerShell
Instructions
Open PowerShell as Administrator
Run the following command
$pendingReboot = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -ErrorAction SilentlyContinue
if ($pendingReboot -ne $null) {
Write-Host "Pending reboot detected."
} else {
Write-Host "No pending reboot found."
}
Here is a sample of the output that is returned when no reboot is needed:
Need Support?
Do you need help? You can access our support portal to create, view, and update tickets anytime.
https://cybercns.freshdesk.com
Click below to be directed to our secure support portal or email support@cybercns.com to open a ticket.
, multiple selections available,
Related content
Internal Support FAQ
Internal Support FAQ
Read with this
How To: Use PowerShell Script to Force Update Agents
How To: Use PowerShell Script to Force Update Agents
More like this
Agent Configurations
Agent Configurations
Read with this
How To: Check Agent Offline Status
How To: Check Agent Offline Status
More like this
Scan Types
Scan Types
Read with this
Company Pending OS Patches
Company Pending OS Patches
More like this