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;
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
@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.
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:
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.
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.
# unlock the sysprefs before unlocking specific panes:
security authorizationdb write system.preferences allow
# unlock network setting:
security authorizationdb write system.preferences.battery allow