Skip to main content

Anyone know of a way to set the time zone on a clean never booted image created with AutoDMG?

If you search time zone on jamfnation you'll probably get some ideas.



We set with post image script
--



#set date, time asap
TIMEZONE="America/New_York"
TIMESERVER="time.company.com"

SetDateAndTime () {
systemsetup -settimezone "$TIMEZONE"
systemsetup -setusingnetworktime off

#backing up old NTP config
mv /private/etc/ntp.conf /private/etc/ntp.conf.`date +%Y-%m-%d_%H.%M.%S`

echo "server $TIMESERVER" > /private/etc/ntp.conf

systemsetup -setusingnetworktime on
sleep 10 #let the clock change before running date
}
SetDateAndTime

Thx @CasperSally I have the time zone script but its loading too late in my imaging process. Just looking for an easier way I guess. If no one knows of a way, I'll hack away at the time zone issue


Loading too late for what? What are you trying to prevent/fix by trying to enable it sooner in the process? Move it to the front of your first boot scripts.


do a payload free package and have it install on priority?
move it to earlier in your script?


My AD bind is not working in the Casper Imaging piece and I think its because my time zone is not set. So I want it to happen pre-bind


We set time with script above for that reason, then we have an ongoing policy set up in JSS for binding (with custom trigger called binding)



After time is set we manually call binding via policy in same script



/usr/sbin/jamf policy -trigger binding


the binding is not dependent on timezone, it's dependent on time. you can't be more than 7min +/- the AD server
hours don't matter.


Systemsetup is your best option here.



/usr/sbin/systemsetup -settimezone "America/New_York" -setnetworktimeserver "time.apple.com"

Thx I have my time and time zone all configured now.


wish this feature was on ipads.