AutoDMG & TimeZone

TomDay
Release Candidate Programs Tester

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

1 ACCEPTED SOLUTION

CasperSally
Valued Contributor II

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

View solution in original post

10 REPLIES 10

CasperSally
Valued Contributor II

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

TomDay
Release Candidate Programs Tester

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

stevewood
Honored Contributor II
Honored Contributor II

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.

jwojda
Valued Contributor II

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

TomDay
Release Candidate Programs Tester

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

CasperSally
Valued Contributor II

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

jwojda
Valued Contributor II

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.

Unknown
New Contributor

Systemsetup is your best option here.

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

TomDay
Release Candidate Programs Tester

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

Malcolm
Contributor II

wish this feature was on ipads.