I have a group of Macs that are all scheduled to shut down at night via a configuration profile.
Recently I've been asked to ensure that these Macs stay on so that they can run processes overnight.
I've added the Macs in question to the Exclusions on the profile's scope and distributed the update to all Macs, but they're still shutting down. I've checked when they're shutting down and it's at the scheduled time, not a cleaner shutting them down in the evening.
To test that they're still talking to the JSS, I've manually unticked the Energy Saver schedule on the Macs' system preferences, then removed the Macs from the exclusions and they've picked up the shutdown time again. I've then added the Macs into the exclusions again and they keep the setting to shut down- what gives?!
Do you have to set a policy to actively set the Macs to not shut down, or am I missing something here?
The JSS is on 9.6
This is the same behaviour I used to get with Workgroup Manager in 10.5. I don't think it behaves that way with other preference settings but is certainly a "feature" with energy saving.
You could scope them to a different config profile to set it the opposite way rather than exclude.
Thanks for the suggestions, guys.
My biggest problem is how you actively set a Mac to not shutdown, as opposed to, as Greg said, essentially leaving the Mac to do what it was already doing.
I'm starting to wonder about scripting a write to the plist, but it seems a little extreme for such a simple thing...
FWIW, so far I've found that the setting is written to /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
However simply modifying the plist doesn't change the setting immediately-- if you go back into System Preferences, the setting is still there, even if you restart cfprefsd.
As far as I can tell, you need to then restart the Mac for System Preferences to show the change.
Not a particularly workable solution if you're trying to do it discreetly in the middle of a working day...!
Thanks again for your help, guys-- I'm persevering with this partly because it's annoying me that I can't work it out and partly because I hope the solution will come in handy to someone searching JAMFNation at some point!
Unfortunately, it looks like you can use the pmset command to schedule a shutdown, but not to cancel one.
pmset -c sleep 0 just resets the settings on the Energy Saver system preferences pane, not the "Schedule.." sub-pane that links off it.
Likewise, config profiles seem to schedule a shutdown but not cancel it-- I want to set the schedule to "not at all" not just another time.
The best solution I've found so far is to script:
/usr/libexec/plistbuddy -c "clear :RepeatingPowerOff:eventtype" /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
and then restart the Mac
but if the objective is to stop the Mac from shutting down in the first place, that seems kinda counter-productive!
The second best solution I've found is simply to add the exclusion to the config profile's scope and then manually untick the settings on the Schedule sub-pane on each Mac. Not a scalable solution if you want to turn it off on hundreds of Macs, but it saves having to restart all the Macs!
I know this thread is old, but I would like to share my solution for this. my situation is same as described in the question, the only different is I only have one Mac instead of a group of Macs.
In this case, I would go to energy saver to set my Mac sleep if idle for 10 mins. I'll run "caffeinate" in terminal if I want to keep it awake.
With this setting, your Mac will sleep whenever it's idle but you also can keep it awake if you want to!