MAC-003 · Script
Power Settings
Reports or sets power settings used while the Mac is on AC power: system sleep, display sleep, disk sleep, restart after power loss and wake for network access. Only settings you pass are changed.
Version 1.0.0Language bashUpdated November 2026
What it does
A configuration profile from your MDM can override these values.
Requirements
macOS 12 or later, run as root (MDM or RMM default). No prompts.
How to run it
- Run as: root (sudo in Terminal, or your MDM default)
- Run from: any MDM or RMM, a LaunchDaemon, or Terminal with sudo
- Script type: shell script (bash)
- User interaction: none; the script never prompts
- Timeout: 10 minutes (longer for app or update installs)
Settings
| Name | What it does | Options | Default |
|---|---|---|---|
| mode | default report | report, apply | report |
| sleep | 0 = never | ||
| display-sleep | 0 = never | ||
| disk-sleep | 0 = never | ||
| restart-after-power-loss | , on, off | ||
| wake-on-lan | , on, off |
Exit codes
- 0 = Settings match, or were applied
- 1 = Settings differ (report mode)
- 2 = Script error
Testing steps
- Run it first with the mode set to report on one test device. Nothing is changed in that mode.
- Read the log and confirm the planned changes are what you expect.
- Run your chosen settings on the same test target and confirm the result.
- Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
- Roll out to a small group next, then everyone.
Rollback steps
Report mode changes nothing and logs the current values. Run again with those values to go back.
Version and change log
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | November 2026 | First release. |