Allow Non Admin users to change Date and Time on MacOS (Mojave 10.14.6)

jsquires3
New Contributor II

I am having troubles allowing non admin users to change the Date and Time on their Macbooks. There are quite a few teachers who let their Macbooks battery drain over the holiday break and when they got back in district their date and time were wrong and they could no longer connect to WiFi.

We had previously enable Non Admins to change their date and time settings with the following command:

#Allow Date/Time Change
security authorizationdb write system.preferences.datetime allow

This unlocks the date and time section within system preferences for non admin users but for some reason when users try to change their date and/or time it reverts back once they click save. For example if the year says 2018 instead of 2020 the staff member changes it to 2020 and clicks save, then the year will change itself back to 2018. (Settings that set the time automatically have been turned off at this point.) We can successfully change the time when logged in as a local admin account but our users are not local admins.

If anyone has any insight as to why users are unable to change their date or time it would be greatly appreciated.

1 ACCEPTED SOLUTION

john_sherrod
Contributor II

I haven't looked at this in quite a while, but this is the script we push out to every Mac we deploy to allow users to make changes to date and time:

# Allows any user to change the date and time on their Mac.

security authorizationdb write system.preferences allow
security authorizationdb write system.preferences.datetime allow

View solution in original post

13 REPLIES 13

john_sherrod
Contributor II

I haven't looked at this in quite a while, but this is the script we push out to every Mac we deploy to allow users to make changes to date and time:

# Allows any user to change the date and time on their Mac.

security authorizationdb write system.preferences allow
security authorizationdb write system.preferences.datetime allow

jsquires3
New Contributor II

john.sherrod

Thank you that fixed my issue. For some reason I was thinking that first line would allow users to change any setting in system preferences but I guess I was wrong.

john_sherrod
Contributor II

@jsquires3 Glad I could help!

ryanmann
New Contributor

Slightly off-topic since I'm experimenting on 10.15.3, but has anyone else noticed that the "authorizationdb" scripts themselves work locally through terminal, but if they're being pushed out as a policy, it errors every time regardless of it being a push or Self Service policy?

AdamCraig
Contributor III

In my testing so far this has worked on 10.15.6 computers as well.

RealSam-12
New Contributor

Hi John, I wasn't able to change the time after running the above-mentioned scripts from admin mode in the terminal. I was getting the error saying " NO (-60008) "

Muzaffar
New Contributor II

this one is not working after macOS ventura upgrade can someone help me to get the new working script 

rafiq
New Contributor

Can anyone update the script for macOS ventura, standard user unable to edit date and time even after running the script

AdamCraig
Contributor III

@Muzaffar @rafiq 

/usr/bin/security authorizationdb write system.preferences.dateandtime.changetimezone allow
/usr/bin/security authorizationdb write system.preferences.datetime authenticate-session-owner-or-admin

This worked for me on Ventura

Found it over on the macadmins slack https://macadmins.slack.com/archives/C03K5RQ6H7S/p1670260127359969?thread_ts=1658494328.335939&cid=C... 
 

Muzaffar
New Contributor II

Thank you so much this works well on Ventura 🙏

Thanks @AdamCraig it is working now users has password prompt where they can put their password to update date and time

This is super helpful, I dont suppose you know how to give our users access to al system preferences without admin rights? 

MikeBlock
New Contributor

I just added these commands to a File/Processes field in a policy and it worked like a charm. Very simple and elegant. Thanks!