@llitz123 Try this out, note I have seen these settings reset themselves so might want to run once a week or at login via Outset.
I modified and tested your script. The following script works:
#!/bin/sh # unlock the sysprefs before unlocking specific panes: security authorizationdb write system.preferences allow # unlock battery: security authorizationdb write system.preferences.battery allow exit 0
thank you for sharing! :)