Posted on 11-03-2022 05:44 AM
Dear Community!
I am having a hard time finding a solution for scheduled machine restarts. I have plenty of mac devices in my fleet and my users tend not to restart their machines once in a while so I wish to set a two week / 1 restart schedule for instance every second week wednesday 17:00 in the afternoon - so they dont come complaining that they are out of memory and their machines are slowing by the day.
Does anyone have any ideas on how to do this? I even wish to have a countdown and a notification to save everything because your machine will automatically reboot in 30 minutes (for instance).
Is this possible to do in Jamf?
Thank you in advance!
David
Solved! Go to Solution.
Posted on 11-03-2022 06:18 AM
you have a few options here.
first would be a config profile that has a startup/shutdown schedule - yet you can't provide options to the end user here.
next would be a policy that has just the restart options configured to your liking with the timer - the policy can have a recurring timeline for execution and also be limited to running at certain times of day via server/client side limitations in the policy - you can also configure user deferral for this.
another would be a policy that runs the restart command(or a script) with a user deferral message/timeline similar to the above options.
Posted on 11-03-2022 07:44 AM
I use a rebranded IBM notifier app for this.
I have a policy that is scoped to machines with 13 days uptime which presents the user with a pop up as show here: https://monosnap.com/file/sRPTun0eiLg7ctJM8XxsuCP7m4gBFQ
The policy is a command line with parameters and underneath that i just run shutdown -r +5 which will auto restart the machine after 5 mins.
Posted on 11-03-2022 06:18 AM
you have a few options here.
first would be a config profile that has a startup/shutdown schedule - yet you can't provide options to the end user here.
next would be a policy that has just the restart options configured to your liking with the timer - the policy can have a recurring timeline for execution and also be limited to running at certain times of day via server/client side limitations in the policy - you can also configure user deferral for this.
another would be a policy that runs the restart command(or a script) with a user deferral message/timeline similar to the above options.
Posted on 11-03-2022 06:19 AM
Hi,
I guess you can make a policy:
In the Computers pane -> Policies -> New Policy -> Restart Options. Select whatever is appropriate for your fleet.
In the "user interaction" pane under you can set the deferral type to "duration" and set the number of days you want.
A warning message should pop-up to users.
Back to the General pane:
I belive "Recurring Check-in" would be the right trigger. However, I am not sure how to get this to run every Wednesday, but you can make the policy run once a week, once a month in the "Execution Frequency" option.
Also it might look like you can tick off the rest of the days in the week you DON'T want the policy to run in the "client-side limitation". (I have not tested this pane myself, so I would try before pushing it out.)
Hope this points you further on to the goal!
Posted on 11-03-2022 07:44 AM
I use a rebranded IBM notifier app for this.
I have a policy that is scoped to machines with 13 days uptime which presents the user with a pop up as show here: https://monosnap.com/file/sRPTun0eiLg7ctJM8XxsuCP7m4gBFQ
The policy is a command line with parameters and underneath that i just run shutdown -r +5 which will auto restart the machine after 5 mins.
Posted on 11-03-2022 07:46 AM
@cgssi this is a great way to do this. I like what you did there.
Posted on 11-04-2022 07:02 AM
Do you know if/how that could be setup with an interactive deferal?
11-04-2022 07:19 AM - edited 11-04-2022 07:20 AM
You could initially set it to run the policy but allow the user to decide if they reboot or not. Give them two buttons to click "Restart Now", "Restart Later". With Restart Later you could end the script or use it to kick off a delay of your choosing
Posted on 01-30-2023 02:05 PM
I'm not really understanding how to assign actions to the buttons. This is the use case I'm looking at also - just a basic restart now/restart later option. Is there documentation I'm missing?
Posted on 11-07-2022 06:30 AM
I have a policy to force reboot devices with a 1 day deferral targeting devices with a 7day up time. If the reboot comes at a bad time users can bump it back 1 day. Since its targeting uptime, custodial users that reboot on their own never see this policy run. I am not too concerned as to when the policy triggers due to the deferral option users have, but you could configure a policy not to run in certain time windows.
Posted on 11-08-2022 12:43 AM
Hi AJPINTO!
Could you please share the process (if you allowed to share) this kind of method would do good for me. Thank you!
Posted on 11-14-2022 07:19 AM
Sure, the nuts and bolts are below.
Extension Attribute:
#!/bin/sh
dayCount=$( uptime | awk -F "(up | days)" '{ print $2 }' )
if ! [ "$dayCount" -eq "$dayCount" ] 2> /dev/null ; then
dayCount="0"
fi
echo "<result>$dayCount</result>"
exit 0