question

ToddChester-3826 avatar image
0 Votes"
ToddChester-3826 asked ToddChester-3826 commented

From the command line, how can I tell if a reboot is pending?

Hi All,

From the command line, how can I tell if a reboot is pending or delayed?

Many thanks,
-T

windows-10-generalwindows-10-securitywindows-server-update-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Sean-Liming avatar image
2 Votes"
Sean-Liming answered ToddChester-3826 commented
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

Using the existing modue is the easy way. If we need some customization, we could use the script below.

Install-Module -Name PendingReboot
Test-PendingReboot -Detailed

160794-pending-reboot-command-line.png

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.


1 Vote 1 ·