I'm formulating custom post-update reboot scripts. Each script prompts, pauses and schedules another procedure. One last piece in the process is to determine if a reboot has occurred outside of the prompt dialogue during a pause, before enforcing a reboot. Does anyone know what registry key or object Software Management polls to determine a reboot is pending?
swolfe - We use a script that checks 3 seperate registry settings, the first only checking for pending filerenames, something KAV used to look at, as far as we found out. That key is:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations and you probably don't want to take this into account.
The other two point to a reboot being needed, the first associated with software installs and the second with Patch Management, so that would be the one Software Management looks at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending\ and the other is:
We haven't looked at any new registry settings for a while, so if anyone can add something to this, we'd be glad to hear it.
@QudjesEric Thank you for the information, I will test this.
Identified the existence of these 2 registry keys reliably report a reboot is pending in my environment.
HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending
HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\PackagesPending
This one doesn't always exist:
Check out gallery.technet.microsoft.com/.../Get-PendingReboot-Query-bdb79542
you can either use this directly or find everything you need in this to create something to test for a reboot pending