Jump to content
RamboBinne

Script to Set a Reboot Pending

Recommended Posts

Hi, 

Windows manage reboot pending with 14 registry key. Some third party app use some of those key and after a deployment its common to see the yellow flag in our start menu. After a reboot Windows manage to erase the related key. Its all in all a good mechanic to manage reboot.

My issue arise with some third party that doesnt use the Windows internal reboot flag mechanic, and yes Automate fall in this category. It know however where to look and across those 14 key below it read the two i've prefixed with **** (as per a ticket resolved by CW, those two key would be the one automate consider in the search condition "computer.os.isrebootpending"

HKLM:\SOFTWARE\Microsoft\Updates
HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager
HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager
****HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services\Pending
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\PostRebootReporting
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
****HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending
HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootInProgress
HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\PackagesPending
HKLM:\SOFTWARE\Microsoft\ServerManager\CurrentRebootAttempts
HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon
HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon
HKLM:\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName

 

we are using some plugin to manage third party software like AV and Backup solution and sometime they report a required reboot. With some monitor, autofix and script twist we parse the database for third party required reboot message, then create a group, then reboot those within over night. It work well.

 

We would however like to use the same registry key as some third party are able to use, to benefit from having just one rebootpending group.

 

the issue is that while some third party app manage to register their required reboot, i fail to find a way to create a key. even in powershell there seem to be no way of calling something like get-rebootpending and set-rebootpending

 

 

 

 

 

Share this post


Link to post
Share on other sites

Just use 

One of the scripts sets a pending reboot by creating a registry entry under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired and adds a scheduled task to delete the entry after a restart.  So no matter which application is requesting it you can get the Automate Agent to notice that a restart is needed.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...