Skip to main content
Question

Unlock Energy Saver Prefs for Non-Admins

  • December 3, 2019
  • 11 replies
  • 46 views

Forum|alt.badge.img+14
  • Valued Contributor
  • 375 replies

Does anybody know a script to unlock Energy Saver prefs for non-admins?

Thanks,
Jared

11 replies

mark_mahabir
Forum|alt.badge.img+15
  • Jamf Heroes
  • 337 replies
  • December 3, 2019

Have a look here.


Forum|alt.badge.img+14
  • Author
  • Valued Contributor
  • 375 replies
  • December 6, 2019

So I tried that command and it did not work. Tried this and same result. Does anybody have anything successfully working?

#!/bin/bash
# Allows non-admin users to change energy saver settings. User needs to be in static user group "Allow Energy Saver Changes"

/usr/bin/security authorizationdb read system.preferences.energysaver > /tmp/system.preferences.printing.plist

/usr/bin/defaults write /tmp/system.preferences.energysaver.plist group everyone

/usr/bin/security authorizationdb write system.preferences.energysaver < /tmp/system.preferences.energysaver.plist


exit 0;

Forum|alt.badge.img+14
  • Contributor
  • 65 replies
  • December 6, 2019

This should unlock it the current logged in user.

#!/bin/bash

security authorizationdb write system.preferences.sharing allow

Forum|alt.badge.img+10
  • Contributor
  • 23 replies
  • December 6, 2019

@rlandgraf That one-liner doesn't for for me. neither does

#!/bin/bash
security authorizationdb write system.preferences.energysaver allow

any other suggestions?


Forum|alt.badge.img+26
  • Esteemed Contributor
  • 516 replies
  • December 20, 2019

Unlocking Energy Saver Settings for Standard User
Also have been trying many things with no success for Catalina


Forum|alt.badge.img+8
  • Valued Contributor
  • 110 replies
  • December 21, 2019

You need to allow access to "system.preferences" prior to "system.preferences.energysaver".

#!/bin/sh
# unlock the sysprefs before unlocking specific panes: 
security authorizationdb write system.preferences allow 

# unlock energysaver: 
security authorizationdb write system.preferences.energysaver allow

Forum|alt.badge.img+9
  • Contributor
  • 162 replies
  • August 26, 2020

@jaz I know you were trying to get this to work for the Security pane here back in 2018. Were you able to get it working? I run the command to allow system.preferences and then to allow system.preferences.security. If I use security authorizationdb read for both then I see allow, but if I open to the Security and Privacy pane and try to unlock it with a non-admin user/password, it just bounces.


josh_miller
Forum|alt.badge.img+5
  • Contributor
  • 15 replies
  • August 27, 2020

Hello there,

I have a script I use that unlocks Date & Time, Energy Saver, Time Machine and Network as well as enables Location Services and Automatic Date & Time and Automatic Time Zone. You can check it out here:

https://github.com/joshua-d-miller/admin-scripts/blob/master/DEP Enrollment/Enrollment.py

It accounts for jamf so the first three variables are empty. Variable 4 can be used to run everything and variable 5 can be used to run individual scripts. For you you can run it with variable 5 set to "sysprefs" which should take care of it. Please give a try and let me know.

Thanks!


MasterNovice
Forum|alt.badge.img+5
  • Contributor
  • 45 replies
  • March 17, 2021

Does anyone have a resource on how Energy Saver management has changed in Big Sur (as Battery)? Our users are Standard non-admin, and we have been employing the security authorizationdb write option to work around allowing them access to various system preferences. In Big Sur this seems to have changed, but I'm unsure if it's that it just can't be managed the same way, the preference name has changed, or something else is affecting the setting. FOr our enrolled and supervised devices, even administrator users cannot modify the Battery pane and get a "Your administrator has not give you access to this pane" display.


vantive
Forum|alt.badge.img+6
  • Contributor
  • 22 replies
  • December 7, 2022

#!/bin/sh
# unlock the sysprefs before unlocking specific panes:
security authorizationdb write system.preferences allow

# unlock network setting:
security authorizationdb write system.preferences.battery allow


Forum|alt.badge.img+1
  • New Contributor
  • 3 replies
  • December 7, 2022

You need to allow access to "system.preferences" prior to "system.preferences.energysaver".

#!/bin/sh
# unlock the sysprefs before unlocking specific panes: 
security authorizationdb write system.preferences allow 

# unlock energysaver: 
security authorizationdb write system.preferences.energysaver allow

Tried this script and works like a charm. This will allow non-admin users to manage the Energy settings.