/
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

  1. Open PowerShell as Administrator

  2. 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:

image-20240619-141320.png

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.


 

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
Read with this
Company Pending OS Patches
Company Pending OS Patches
More like this