These are the registry keys being checked when machines are stuck on pending restart:
HKLM\System\CurrentControlSet\Control\Session Manager value: PendingFileRenameOperations
HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired
HKLM\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending
HKLM\Software\Microsoft\Updates value: UpdateExeVolatile
The PendingFileRanemeOperations is the most common culprit for the issue wherein different applications are being left behind in the registry key value. To resolve the issue, one way is to add the setting _BESClient_ActionManager_PendingRestartExclusions wherein the value should be formatted as “application1;application2;application3” (Note: The value is case sensitive)
Example:
_BESClient_ActionManager_PendingRestartExclusions = spool;DRIVERS