[Samba] time server = yes

Toby Bluhm tkb at MidwestInstruments.com
Thu Dec 6 17:12:03 GMT 2007


Adam Williams wrote:
> I want my XP clients to update their clocks from my samba server.  I 
> have time server = yes in smb.conf, and running ntpd on the server, 
> but my clients aren't updating their clocks.  I tried running the 
> command manually logged in as a domain user:
>
> net time /setsntp:10.8.2.3
>
> but it just says "System error 5 has occurred.  Access is denied".
> Any ideas?
>

The relationship of "net time" and a real ntp server seems to be a one 
time sync only anyway. However, you can have the PC really use ntp:

:: setup ntp client
:: need to be an admin - one time setup
sc stop w32time
w32tm /unregister
w32tm /register
net time /setsntp:ntpd-server
sc config w32time start= auto
sc start w32time
w32tm /resync
w32tm /stripchart /computer:ntpd-server /samples:1

Could instead use a real Policy or manually jam it into the registry:

:: setup ntp client
:: need to be an admin - one time setup
reg add HKLM\SOFTWARE\Policies\microsoft\w32time /f
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\Parameters /f
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\TimeProviders /f
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\TimeProviders\NtpClient /f
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\Parameters /v NtpServer 
/d ntpd-server /f
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\Parameters /v Type /d 
NTP /f
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\TimeProviders\NtpClient 
/v Enabled /t REG_DWORD /d 0x1 /f
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\TimeProviders\NtpClient 
/v CrossSiteSyncFlags /t REG_DWORD /d 0x2
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\TimeProviders\NtpClient 
/v ResolvePeerBackoffMinutes /t REG_DWORD /d 0xf
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\TimeProviders\NtpClient 
/v ResolvePeerBackoffMaxTimes /t REG_DWORD /d 0x7
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\TimeProviders\NtpClient 
/v SpecialPollInterval /t REG_DWORD /d 0xe10
reg add HKLM\SOFTWARE\Policies\microsoft\w32time\TimeProviders\NtpClient 
/v EventLogFlags /t REG_DWORD /d 0x0
gpudate /target:computer /force


-- 
Toby Bluhm
Midwest Instruments Inc.
30825 Aurora Road Suite 100
Solon Ohio 44139
440-424-2240




More information about the samba mailing list