Forum Discussion
PowerShell Patching Question - Query for "Schedule the Restart" value
Hi Jake - The below 2 articles have scripts to check for the restart flag that is set in registry indicating a restart is required - which may also be useful here
https://4sysops.com/archives/use-powershell-to-test-if-a-windows-server-is-pending-a-reboot/
https://adamtheautomator.com/pending-reboot-registry/
This article contains the relevant registry keys involved in Windows Update
https://docs.microsoft.com/en-us/windows/deployment/update/waas-restart
the last key listed in the article is the one it sounds like you are after...
| ScheduledInstallTime | REG_DWORD | 0-23: schedule update installation time to a specific hour starts with 12 AM (0) and ends with 11 PM (23) |
Hey Steve, thanks for the response.
I thought the reg value you listed below: ScheduledInstallTime might be related to the "Schedule the Restart" option. However I scheduled the restart but did not see the value, it actually doesn't exist for me.
I went a step further and used Regshot to compare a before and after of the registry. Nothing of note shows up in the results.
I thought maybe a scheduled task or something gets logged in the event logs, no luck.
I will keep looking but running out of ideas, Microsoft is hiding this pretty well.