Hi All,
From the command line, how can I tell if a reboot is pending or delayed?
Many thanks,
-T
Hi All,
From the command line, how can I tell if a reboot is pending or delayed?
Many thanks,
-T
StackOver flow has some PowerShell suggestions: https://stackoverflow.com/questions/47867949/how-can-i-check-for-a-pending-reboot#:~:text=Pending%20reboot%20can%20be%20caused%20by%20variety%20of,Install%20Install-Module%20-Name%20PendingReboot%20%23%20Run%20Test-PendingReboot%20-Detailed
Hi,
Using the existing modue is the easy way. If we need some customization, we could use the script below.
Install-Module -Name PendingRebootTest-PendingReboot -Detailed

Alternatively, we can check the following registry values with customized script to suit for our actual needs.
The RebootPending value at
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing
The RebootRequired value at
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update
The PendingFileRenameOperations value at
HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager
And the script (from 4sysops) is here:
Alex
If the answer is helpful, please click "Accept Answer" and kindly upvote it.
8 people are following this question.