You can do it through the registry:
- Registry entries for the W32Time service
- Configuring the Time Service: NtpServer and SpecialPollInterval
Alternatively, you could interact with the W32tm console utility.
The Date and Time control panel (timedate.cpl) does this with a call to W32TimeSetConfig
from w32time.dll, but that appears to do nothing but set the NtpServer
value in HKLM\System\CurrentControlSet\Services\W32Time\Parameters
.