Home > Mac administration, Mac OS X > Disabling the Sleep command in the Apple menu

Disabling the Sleep command in the Apple menu

After recently participating in a discussion about disabling the Sleep command in the Apple menu, I wanted to document how to do this. This may be most useful for Mac terminal services, which was the context where I learned how to do this.

1. Log in with an account that has admin privileges

2. Open Terminal and run the following command:

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.PowerManagement SystemPowerSettings -dict SleepDisabled -bool YES

Screen Shot 2013-01-26 at 9.48.54 PM

3. You should see that the Sleep command is now grayed-out in the Apple menu.

Screen Shot 2013-01-26 at 9.48.58 PM

To revert back, you’ll need to do the following:

1. Log in with an account that has admin privileges

2. Open Terminal and run the following command:

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.PowerManagement SystemPowerSettings -dict SleepDisabled -bool NO

Screen Shot 2013-01-26 at 10.00.34 PM

3. Restart the Mac (this is necessary to apply the change.)

After the restart, you should see that the Sleep command is available again in the Apple menu.

Screen Shot 2013-01-26 at 9.52.41 PM

  1. January 27, 2013 at 5:23 am

    A bit off topic, but could you share your thoughts on the IRAPP TS? We’ve looked at AquaConnect in the past as well, but held off purchasing.

    • January 27, 2013 at 8:24 am

      Jason,

      I haven’t previously used the iRAPP terminal service. CodeRebel’s support article showed me how to disable the sleep function, but I don’t have direct experience with their terminal service software.

      I had tested AquaConnect at my previous workplace and it seemed OK.

  2. Tom Tubbiola
    January 28, 2013 at 1:47 am

    Thanks for this Rich. It will make my life easier than trying to teach my designers to just log out.

  3. Kerbau
    June 10, 2016 at 4:14 pm

    Do you have any idea to do this on El Capitan?

    • Mx45
      June 29, 2016 at 2:27 pm

      Exactly as described. It still works.

  4. Linh Chau
    July 12, 2016 at 10:37 pm

    This one works on El Capital:
    sudo pmset -a disablesleep 0

    • Poes Snel
      December 2, 2016 at 1:22 pm

      This doesn’t work on Sierra

    • mockingbird
      June 19, 2019 at 10:51 am

      This works in Sierra like a charm, thank you very much!)

  5. May 22, 2017 at 3:29 pm

    Hello Rich…any info on how to do this for the ‘Shutdown’ command? I don’t need people arbitrarily shutting machines down(happens) when I need to run remote maintenance or updates or builds or troubleshooting and such. :-\ Thank You ! ~Patrick

  6. carlvaneijk
    June 5, 2017 at 7:14 pm

    Took me ages to find this! My sleep somehow became disabled, ( I think i was a bit agressive with an MDM policy and something broke) Worked a treat to resolve. Thanks!
    C

  7. September 7, 2017 at 3:11 pm

    I’m finding this setting has moved to in Sierra (10.12.3) and a profile does not see to work to manage it. The following command is working for me to gray out the Sleep option in the Apple menu after a user logs in:

    sudo defaults write /Library/Preferences/com.apple.PowerManagement.plist SystemPowerSettings -dict SleepDisabled -bool YES

    Thanks for the post!

  1. No trackbacks yet.

Leave a comment