Reboot Policy - 'Pending Restart' immediately after reboot

I currently have a policy action set to reboot server devices. The relevance is set to:

“Pending Restart”

The action is scheduled to run every Sunday between 06:00-07:00 GMT.
the policy action is set to "Reapply This Action -> While Relevant Waiting -> 5 Days"
the post action is set to “Restart Computer after action completes” with a deadline of "2 minutes"
It is successful when all lines of the action script are successful.

The action script runs a script that alters our monitoring system but does not contain any “action requires restart”

The action works well on most devices. However, I am finding that some devices reboot and return ‘Pending Restart’ if I check the “BESPendingRestart” and “PendingFileRenameOperations” registry keys they have values.

My problem is that this action will never run again.

I have tried putting relevance in above the ‘Pending Restart’ that would be false if the uptime was less than 5 days, but that did not effect the results.

Is there any way that I can reboot the server, and have it waiting for the next reboot window even if the device is pending restart after the initial reboot?

To eliminate the issue, set relevance to true rather than pending reboot and set success to action script completed sucessfully. That way the action will always run.

Yes, that would work, however, my users only want a reboot if it is required. By taking the ‘pending restart’ out of the relevance, devices will reboot every time. Not only when it is needed.

Is there no other way?

I’ve done more testing on this and found that it has nothing to do with the relevance. It will return ‘Pending Restart’ regardless. I tested with a very simple action that has relevance set to True with ‘all lines of script have completed successfully’ and a post action to reboot. If the device is pending restart = true after the reboot it will always result in an action status of ‘Pending Restart’.

I tested it with the action script . . . ‘reboot 60’ and the post action reboot with the relevance set to relevance ‘true’. No matter what, it results in an action status of ‘Pending Restart’

I tested it with the action script . . . ‘waithidden shutdown.exe /r /t 90 /f’. This actually works the way I want it to. I can even add back the relevance statement ‘pending restart’ and it will return an action status of ‘Completed’. However, I do not want to change the reboot method since we have been using the post action with the message and option to postpone for quite a while.

Any suggestions?