Force Date/Time Synchronization

Joined
Nov 15, 2011
Messages
1
Reaction score
0
Points
1
(first time poster!)

I manage several hundred Macs (OSx10.6) that bind to AD. Many are having issues losing time synchronization to our AD time sync server.

Is there a way to to push out a login script (before user logs in) that will force time synchronization to our server or time.apple.com? Currently when Mac's lose the time sync, the user can't login. I then have to login as administrator, check the box to sync time and then all is well.

I have a UNIX command I created that does what I want, but not sure how to push the command out to all users. We use Xserver (workroup manager) to push out settings, can I push out a login script from there? If so, how do I save the .txt document with the UNIX command?

Sorry, new to scripting!

Here is the script I wrote:

#!/bin/sh
# Turn on or off using network time.

systemsetup -setusingnetworktime on

#Primary Time server
TimeServer1=10.6.6.1
#Secondary Time server
TimeServer2=time.apple.com

# Set the primary network server with systemsetup -setnetworktimeserver
# Using this command will clear /etc/ntp.conf of existing entries and
# add the primary time server as the first line.
/usr/sbin/systemsetup -setnetworktimeserver $TimeServer1

# Add the secondary time server as the second line in /etc/ntp.conf
echo "server $TimeServer2" >> /etc/ntp.conf[/I][/I]
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top