Set Time zone on Monterey OS + M1 chip Mac

New Contributor II


Can anyone help me to provide the latest "SetTimeZone and SetTimeServer" Jamf script? as their old scripts are not working in M1+Monterey OS. Scripts are executing without any error but Time Zone>>"Set time zone automatically using current location" tick is not not enabled. 


Valued Contributor

Set time zone automatically using current location works based on location services. If the location services is turned off this will not be enabled. You can use the below script to turn on location services (requires restart) and then Set time zone automatically using current location will enable.


## enabling location services
/usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/ LocationServicesEnabled -int 1

uuid=$(/usr/sbin/system_profiler SPHardwareDataType | grep "Hardware UUID" | cut -c22-57)
/usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/$uuid LocationServicesEnabled -int 1

## configure automatic timezone
/usr/bin/defaults write /Library/Preferences/ Active -bool YES
/usr/bin/defaults write /private/var/db/timed/Library/Preferences/ TMAutomaticTimeOnlyEnabled -bool YES
/usr/bin/defaults write /private/var/db/timed/Library/Preferences/ TMAutomaticTimeZoneEnabled -bool YES
/usr/sbin/systemsetup -setusingnetworktime on
/usr/sbin/systemsetup -gettimezone
/usr/sbin/systemsetup -getnetworktimeserver


To all, we have had some interns help with our 250, refresh. They forgot to adjust location time, at least half are pacific time. Thanks for posting!





I have been using this exact script on my Jamf server for years