Hello There,
I want a policy on JAMF that all Mac users' laptops will auto-restart after 25 days.If anybody has it please do post.
Thanks
Hello There,
I want a policy on JAMF that all Mac users' laptops will auto-restart after 25 days.If anybody has it please do post.
Thanks
Best answer by user-dIrrpGXxza
We have this implemented, but after a longer period which is 60 days because of the concerns posted by others in this thread.
Here's how to do it:
Step 1 - implement an extension attribute using the following script/config:
Data type: YYYY-MM-DD hh:mm:ss
Inventory display: Operating system
Input type: Script
The script:
#!/bin/bash
# Get boottime in epoch time, convert to Jamf Pro formatted time and make an extension attribute
#
# Updated: 2.23.2022 @ Robjschroeder
#
bootTime=$(sysctl kern.boottime | awk '{print $5}' | tr -d ,)
formattedTime=$(date -jf %s $bootTime "+%F %T")
echo "<result>${formattedTime}</result>"
exit 0
Step 2 - create smart group:
Criteria: <your extension attribute> - More than x days - input 25, 60 or whatever days here
Step 3 - create policy and scope it to the above smart group:
* Configure the general tab with recurring check-in as trigger, and make it recurring once a week so that it doesn't trigger again until an inventory update has been run in the vast majority of cases
* Configure restart options in the policy as desired
* Configure the User Interaction tab, preferably with a message with what is about to happen, preferably with a deferral type for x days (we use 3)
And presto!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.