Restart Devices on a Schedule
I have what I believe to be a very simple task:
I need to restart a few endpoints on a regular schedule every night, so each day those endpoints are updated and ready to go without needing any restarts during working hours.
This is not extreme, nor is it unreasonable - nonetheless, this cannot be done using Atera. If there is someone out there that has a solution, I'm all ears. But I'm currently very tired of having to script away all the road blocks Atera affords me.
This post is really for product development, but maybe someone else will find it entertaining.
Before Configuration Policies existed, my only option to acheive this task was to use IT Automation. So I created an automation policy called "Reboot everyday at 3am". The only tasks selected in this IT Automation are:
- The schedule to run every day at 3am
- Create a System Restore point
I applied this IT Automation to the endpoints that needed it - these are non-servers at multiple customers that typically stay on 24x7 (like conference room computers). Sometimes they get shut off in the course of being used, but it isn't a problem.
I've received complaints over the last few months of endpoints restarting at random intervals, without warning, and during working hours.
I opened a support ticket and the technician determined it was caused by something I did. At the time it wasn't very impactful and I figured maybe it was an isolated incident, so I didn't dig too much into it. And for a while, things were silent on this topic.
This morning I get a call from one of the Directors at my client. They had a Teams meeting in the conference room that lasted 1.5hrs, and during that time the endpoint restarted 3 times during their meeting. I knew I needed to get to the bottom of this, so I opened another support ticket.
The technician found all 3 restarts in the Windows Event logs, and the custom comment on the restarts indicated they were triggered by Atera.
Use a Configuration Policy!
I detailed what I had configured in Atera and the technician did a little digging. He found the culprit - all IT Automation policies are set to queue up missed policy applications for offline agents for up to 1 week.
This means that particular endpoint was offline during 3 scheduled applications of the IT Automation policy "Reboot everyday at 3am". Now that it's back online, that policy ran 3 times consecutively.
The technician proposes a new solution - use a Configuration Policy. This way I would be able to control the ability for the endpoint to reboot. I thought, great!
I had setup a test Configuration Policy about 5 months ago to test out reboot notifications that would be displayed to the user. I applied the test policy to my laptop and forgot about it. In 5 months time I had never received any notification that my laptop needed to restart. So in the back of my mind, I had categorized the Configuration Policy as a beta feature and did nothing further with it. I mentioned this to the technician and he did some more digging.
He then discovered the issue here - I needed to have the option called "Reboot when needed" checked in the IT Automation policy. The only place this is detailed in the product documentation is here: https://support.atera.com/hc/en-us/articles/5499183257884
It is not covered in the Troubleshooting section at the bottom of that article, nor is it covered in the guide on setting up a Configuration Policy: https://support.atera.com/hc/en-us/articles/5499199743388-Set-up-configuration-policies
No worries, I didn't read it all the way through - that's on me. But then I started thinking about the setting itself "Reboot when needed". And I thought, but I don't want to reboot when needed - I want to guarantee the endpoints get rebooted at 3am every day…
An Impossible Solution
My constraints on the original task are as follows:
- The endpoint must reboot at 3am every day.
- The endpoint must not reboot outside of this schedule, especially during working hours.
Again, not extreme and not unreasonable.
As it turns out, this cannot be done. If I specify the "Reboot" option in the IT Automation policy, the endpoint will reboot regardless of any Configuration Policy.
And if I specify the "Reboot when needed" option in the IT Automation policy, the endpoint will only be rebooted if Windows Update requests a reboot.
And the Configuration Policy cannot be used to initiate a reboot, period. It can only be used to control reboots as a result of Windows Update.
I thought, ok - the only solution is to stop all IT Automation policies from running missed applications for offline endpoints…
Nope! I can't do that either.
Ok ok ok, last resort - I can script the reboot. But then the only way I can apply the script on a schedule is to use an IT Automation policy, and that brings us right back to square 1 🤦♂️
A Solution, Anybody…
At this point I have a headache.
I could create a script based threshold that checks to see if the computer has not been restarted in 24hrs; if not, raise an alert and run a script automatically to reboot the endpoint. But I cannot schedule this option, so this is no good.
I could create a script that runs at 3am and checks the Windows Event log to see when it was last restarted; if it's been more than 24hrs, reboot. But if the endpoint has been turned off for more than 24hrs this will reboot one time when the IT Automation policy applies. So this isn't a good solution either.
I could create a script exactly like above, but this one queries WMI for the boot time. Then I need to diff the boot time from the current time to see if the delta is >24hrs; if so, reboot. Well, this one may actually work.
Is this a very specific use case? Yes. Is this entirely annecdotal? Yes. Should this be an issue at all? Absolutely not.
Here are some things that would improve the functionality of Atera and avoid this and probably other problems I haven't encountered yet:
- Add an option to not queue up missed IT Automation policies at all - if they're missed, they're missed.
- Add an option to not stack all missed IT Automation policies and run them at once. I'm not sure what the use case is for the current configuration, but allowing me to configure running a missed policy once would be nice.
- Allow each IT Automation policy have a configurable setting for running on offline agents, instead of the current global setting.
- Since Configuration Policies seem to be designed to control the state of an endpoint, add a state in there to limit uptime (reboot).
- All Topics
- 18 Getting started
- 12 Read before posting
- 6 Meet and greet
- 113 General
- 38 News and announcements
- 29 Resources
- 5 Knowledge Base
- 5 Webinars
- Shared Script Library
- 3 Pro Tips
- 16 Got an idea?
- 66 Remote Monitoring and Management
- 54 Remote Monitoring
- 12 Patch Management
- 50 Professional Services Automation
- 30 Helpdesk
- 7 Billing
- 13 Reporting
- 15 Integrations & add-ons
- 10 Integrations
- 4 Add-ons
- 45 Scripting and automations
- 34 Scripts
- 10 Automations