Skip to content

Instantly share code, notes, and snippets.

@opshope
Last active October 19, 2022 18:58
Show Gist options
  • Save opshope/de0801a36b5438e9baa4 to your computer and use it in GitHub Desktop.
Save opshope/de0801a36b5438e9baa4 to your computer and use it in GitHub Desktop.
Enable location services and set time zone automatically Mac
#stolen from https://jamfnation.jamfsoftware.com/discussion.html?id=12979
/bin/echo "set time zone automatically using current location"
# enable location services
/bin/launchctl unload /System/Library/LaunchDaemons/com.apple.locationd.plist
uuid=`/usr/sbin/system_profiler SPHardwareDataType | grep "Hardware UUID" | cut -c22-57`
/usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.$uuid LocationServicesEnabled -int 1
/usr/sbin/chown -R _locationd:_locationd /var/db/locationd
/bin/launchctl load /System/Library/LaunchDaemons/com.apple.locationd.plist
# set time zone automatically using current location
/usr/bin/defaults write /Library/Preferences/com.apple.timezone.auto Active -bool true
/usr/sbin/systemsetup -setusingnetworktime on
/usr/sbin/systemsetup -gettimezone
/usr/sbin/systemsetup -getnetworktimeserver
@syoung-quizlet
Copy link

This seemed to complain about SEP being enabled. Does this work on 10.15?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment