Warn User Before Rebooting (Maintenance Sessions)


Right now, we have all tasks on our Maintenance Sessions set to ‘suppress’ reboots.
We want to change this to ‘If necessary’.

However, from our testing: When Immy.bot wants to restart the machine, it will do so immediately. Sometimes requiring multiple restarts during a single maintenance session.

Ideally, we would like for all tasks to be carried out, then warn the user about the imminent restart with the standard Windows notice:
'Your PC needs to restart to finish installing important updates. If you’ve already saved everything, you can restart now. Otherwise, you should take a moment to save your work."

But this does not currently seem to be possible, so I would like to submit this as a feature request.

Ideally, this would go under “System Preference”, “Company Preferences”, or directly next to the option for “Reboot” in the Deployment

The best way to do this currently is to use this task in cross tenant deployments:

And put it in the ordering as the very first item. It will notify the user that Immy is trying to run maintenance, and will have a yes or no decision for them if they would like to consent.

What would happen with the Maintenance Session if the user did not respond to that prompt?

Because our Maintenance Plan is designed to run over the weekend, when the user /typically/ not at their computer. However, we ran into issues with some users working over the weekend losing unsaved data because of the automatic restart.

While this would address the users who actively use their computer over the weekend (Minority)
It sounds like it would present a new complication, where users who didn’t answer that prompt, will now only have this run Monday-Friday when they are in front of the machine.

Our goal is to have the Maintenance Sessions run Saturday nights

You can choose. There is a timeout period, after which it will choose the default you set:

Thank you very much.

This is a good approach in the meantime. I have deployed this task.

I would like for my formal request to be considered, as this Window is quite small and some users still may not see it. Ideally we would love for the prompt to look similar to:

1 Like

Fair enough. If you need a larger window with that task though, you can also set the DefaultTimeout parameter to be something greater than 60 seconds.

Yes, I updated the message and timeout to 15 minutes.

This is an okay work around in the meantime, though we don’t really want for people to be able to decline system maintenance. We just want to give them a warning about reboots and offer them time to save their work, which currently isn’t possible otherwise.

Understandable. If you’ve got some knowledge of PowerShell, it isn’t too hard to duplicate the task and its script and adjust the window to what you need it to be. I’ve got my own version of it that uses WPF instead of the standard msgbox.

Is it possible to enforce this only when the user clicks on Yes, or is logged off?

We don’t want machines restarting unless either of those criteria are true.

Might need to adjust the task, as I was mentioning before. You would be able to set the default answer to “no”, so if it times out or isn’t seen, it won’t restart. However, I believe that when they are logged off it will still default to “no”. It would be best to take a look at the task script to verify


After testing - This task is not sufficient

If no users are signed in, this will still default to ‘no’ and system maintenance will not run.