In our environment, we have Mac machines which are joined to window’s domain. Once in while machine will not log on to domain because the OS clock had a different time than the domain controller and sooner you fix the clock, machine will start communicating with domain controller.
I was wondering if there is an easier way to do this using script which can run every few hours to force the OS clock to synchronize with the domain controller.
I don’t know exactly but currently we manually set the time and date. May be using AdmitMac (the application we use to bind our Macs to windows domain) but again not sure how would I use this app to check the time from time server.
If you look in System Preferences under Date & Time, you’ll see that you can set the Mac to automatically set the date & time. There are preset time servers, but I believe you can change them to another time server, possibly the one that the PCs are using.
I have looked under system preference and Date and Time settings but there are only 3 time servers (America, Asia and Europe). I was unable to find any place where I can edit those entries or even add another timer server.
Tiger’s `systemsetup’ is found under “/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup”
The following script is OK for me…
set the hexData to system attribute "sysv"
set hexString to {}
repeat 4 times
set hexString to ((hexData mod 16) as string) & hexString
set hexData to hexData div 16
end repeat
set OS_version to hexString as integer
if OS_version > 1040 then
if OS_version < 1050 then
set util to "/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup"
else
set util to "/usr/sbin/systemsetup"
end if
do shell script util & space & "-setnetworktimeserver time.euro.apple.com -setusingnetworktime on" user name "?????" password "¢¢¢¢¢¢" with administrator privileges
end if
set OS_version to ((system attribute "sysv") mod 4096 div 16)
if OS_version < 4 then return
if OS_version = 4 then
set util to "/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup"
else
set util to "/usr/sbin/systemsetup"
end if
do shell script util & space & "-setnetworktimeserver time.euro.apple.com -setusingnetworktime on" user name "?????" password "¢¢¢¢¢¢" with administrator privileges