Skip to main content
Solved

AutoDMG & TimeZone

  • June 11, 2014
  • 10 replies
  • 41 views

Forum|alt.badge.img+22

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

Best answer by CasperSally

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

10 replies

Forum|alt.badge.img+17
  • Honored Contributor
  • Answer
  • June 11, 2014

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

Forum|alt.badge.img+22
  • Author
  • Honored Contributor
  • June 11, 2014

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
Forum|alt.badge.img+38
  • Hall of Fame
  • June 11, 2014

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.


ImAMacGuy
Forum|alt.badge.img+23
  • Esteemed Contributor
  • June 11, 2014

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


Forum|alt.badge.img+22
  • Author
  • Honored Contributor
  • June 11, 2014

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


Forum|alt.badge.img+17
  • Honored Contributor
  • June 11, 2014

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


ImAMacGuy
Forum|alt.badge.img+23
  • Esteemed Contributor
  • June 11, 2014

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.


Forum|alt.badge.img
  • New Contributor
  • June 11, 2014

Systemsetup is your best option here.

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

Forum|alt.badge.img+22
  • Author
  • Honored Contributor
  • June 11, 2014

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


Forum|alt.badge.img+13
  • Valued Contributor
  • September 17, 2014

wish this feature was on ipads.