Clear/Remove a Pending Restart?

Once an action has set a pending restart with something like

action requires restart "MyPatchWindow"

…is there a way to clear that pending restart status? I’ve had an issue where a very small set of clients get stuck when running through a patch window. They have a previously-set pending restart on my post-patch reboot action, which makes them not relevant to my Restart fixlet. I think this may have been originally caused by a client reregistration or BES client reinstall that left a previous Pending Restart status.

Manually removing the entry from HKEY_LOCAL_MACHINE\software\wow6432node\bigfix\enterpriseclient\BESPendingRestart does not seem to clear the Pending Restart “MyPatchWindow” status, even if I restart the BES client after deleting the entry.

Is there any method available for removing a Pending Restart entry?

1 Like

So you are saying if you reboot, it doesn’t clear the status, and if you delete the reg keys manually and reboot, it also doesn’t clear the status?

Why does this prevent it from being relevant to your restart fixlet? what is the relevance? Could it be adjusted to compensate for this?

If I reboot, it does clear the ‘pending restart’ status. My Task to reboot after patching includes, among its other checks,

not pending restart "MyPatchWindow"

Part of the ActionScript for this reboot task includes

action requires restart "MyPatchWindow"

The intent is to ensure that the Reboot task only runs one time during the patch cycle. Once it has popped-up and prompted the user to restart, I don’t want it to take effect again until the reboot has occurred.

Where I’m running in to a problem is a small number of systems that have a previously-set Pending Restart for MyPatchWindow. Those won’t become relevant for the Restart task (unless the user decides to reboot the machine on their own).

I know I can work around this by modifying my Task Relevance to stop checking for the Pending Restart state; but what I’d really like is the ability to clear the pending restart from ActionScript. Then, my Task that activates the client’s Patch Window could clear any previous Pending Restarts for the patch window.

1 Like

What happens if you stop/restart the BESClient service?

It won’t affect this. This is only cleaned up when the OS removes all the reboot required elements - the client doesn’t do that.

I feel that the action that actually performs the restart should not be the one to mark the system as needing the restart.

I would instead have a task at the end of each baseline that sets something like:

action requires restart "MyPatchWindow1"

The task that actually prompts the user to reboot would have relevance similar to:

pending restart AND uptime > 1*day AND ???

The idea would be that you could have many different patching baselines, but only prompt the user to reboot once.

Thanks, yes I think I’ll have to remove the action requires restart from the restart action itself.

1 Like

The actionscript action requires restart sets it for sure. However action may require restart will only set the pending restart on and flag it for this action IF something is set that requires a restart. The only unfortunate side effect is if there is already a pending restart when things start it cannot determine the difference.

I’ve got the same issue caused by some GPO settings. You can check Windows “reboot pending” status on those clients with Get-PendingReboot.