Open in the explorer

Configure Windows NTP Client

Configurer le client NTP Windows

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › System › Windows Time Service › Time Providers FR: Configuration ordinateur › Stratégies › Modèles d'administration › Système › Service de temps Windows › Fournisseurs de temps
Supported on
At least Windows Server 2003 operating systems or Windows XP Professional FR: Au minimum Windows Server 2003 ou Windows XP Professionnel
ADMX file
W32Time.admx
Internal name
W32Time/W32TIME_POLICY_CONFIGURE_NTPCLIENT

Explanation

This policy setting specifies a set of parameters for controlling the Windows NTP Client.

If you enable this policy setting, you can specify the following parameters for the Windows NTP Client.

If you disable or do not configure this policy setting, the WIndows NTP Client uses the defaults of each of the following parameters.

NtpServer
The Domain Name System (DNS) name or IP address of an NTP time source. This value is in the form of ""dnsName,flags"" where ""flags"" is a hexadecimal bitmask of the flags for that host. For more information, see the NTP Client Group Policy Settings Associated with Windows Time section of the Windows Time Service Group Policy Settings. The default value is ""time.windows.com,0x09"".

Type
This value controls the authentication that W32time uses. The default value is NT5DS.

CrossSiteSyncFlags
This value, expressed as a bitmask, controls how W32time chooses time sources outside its own site. The possible values are 0, 1, and 2. Setting this value to 0 (None) indicates that the time client should not attempt to synchronize time outside its site. Setting this value to 1 (PdcOnly) indicates that only the computers that function as primary domain controller (PDC) emulator operations masters in other domains can be used as synchronization partners when the client has to synchronize time with a partner outside its own site. Setting a value of 2 (All) indicates that any synchronization partner can be used. This value is ignored if the NT5DS value is not set. The default value is 2 decimal (0x02 hexadecimal).

ResolvePeerBackoffMinutes
This value, expressed in minutes, controls how long W32time waits before it attempts to resolve a DNS name when a previous attempt failed. The default value is 15 minutes.

ResolvePeerBackoffMaxTimes
This value controls how many times W32time attempts to resolve a DNS name before the discovery process is restarted. Each time DNS name resolution fails, the amount of time to wait before the next attempt will be twice the previous amount. The default value is seven attempts.

SpecialPollInterval
This NTP client value, expressed in seconds, controls how often a manually configured time source is polled when the time source is configured to use a special polling interval. If the SpecialInterval flag is enabled on the NTPServer setting, the client uses the value that is set as the SpecialPollInterval, instead of a variable interval between MinPollInterval and MaxPollInterval values, to determine how frequently to poll the time source. SpecialPollInterval must be in the range of [MinPollInterval, MaxPollInterval], else the nearest value of the range is picked. Default: 1024 seconds.

EventLogFlags
This value is a bitmask that controls events that may be logged to the System log in Event Viewer. Setting this value to 0x1 indicates that W32time will create an event whenever a time jump is detected. Setting this value to 0x2 indicates that W32time will create an event whenever a time source change is made. Because it is a bitmask value, setting 0x3 (the addition of 0x1 and 0x2) indicates that both time jumps and time source changes will be logged.

French text from Windows 11 26H2

Ce paramètre de stratégie spécifie un ensemble de paramètres visant à contrôler le client NTP Windows.

Si vous activez ce paramètre de stratégie, vous pouvez spécifier les paramètres suivants pour le client NTP Windows.

Si vous désactivez ce paramètre de stratégie ou ne le configurez pas, le client NTP Windows utilise les valeurs par défaut de chacun des paramètres suivants.

NtpServer
Nom DNS (Domain Name System) ou adresse IP d’une source de temps NTP. Cette valeur prend la forme « Nomdns,indicateurs » dans laquelle les indicateurs désignent la valeur hexadécimale des indicateurs pour l’hôte concerné. Pour plus d’informations, voir la section Paramètres de stratégie de groupe du client NTP associés au temps Windows des paramètres de stratégie de groupe du service de temps Windows. La valeur par défaut est « time.windows.com,0x09 ».

Type
Cette valeur contrôle l’authentification qu’utilise W32time. La valeur par défaut est NT5DS.

CrossSiteSyncFlags
Cette valeur, exprimée sous forme d’un masque de bits, contrôle la manière dont W32time choisit les sources de temps hors de son site. Les valeurs possibles sont 0, 1 et 2. Définir cette valeur sur 0 (Aucun) signifie que le client de temps ne doit pas essayer de synchroniser le temps hors de son site. Définir cette valeur sur 1 (PDC uniquement) signifie que seuls les ordinateurs fonctionnant comme maîtres d’opérations d’émulateur pour le contrôleur de domaine principal (PDC) dans d’autres domaines peuvent servir de partenaires de synchronisation lorsque le client doit synchroniser le temps avec un partenaire hors de son propre site. Définir la valeur sur 2 (Tous) indique qu’il est possible de faire appel à n’importe quel partenaire de synchronisation. Cette valeur est ignorée si la valeur NT5DS n’est pas définie. La valeur par défaut est le nombre décimal 2 (0x02 hexadécimal)..

ResolvePeerBackoffMinutes
Cette valeur, exprimée en minutes, contrôle le délai d’attente de W32time avant toute tentative de résolution d’un nom DNS en cas d’échec de la tentative précédente. La valeur par défaut est fixée à 15 minutes.

ResolvePeerBackoffMaxTimes
Cette valeur contrôle le nombre de tentatives de résolution d’un nom DNS par W32time avant que le processus de découverte ne soit relancé. Chaque fois que la résolution d’un nom DNS échoue, le délai d’attente précédant la tentative suivante est multiplié par 2. La valeur par défaut est fixée à 7 tentatives.

SpecialPollInterval
Cette valeur de client NTP, exprimée en secondes, contrôle la fréquence d’interrogation d’une source de temps configurée manuellement si un intervalle d’interrogation est défini pour cette source. Si l’indicateur SpecialInterval est activé sur le paramètre NTPServer, le client utilise la valeur définie comme SpecialPollInterval, au lieu d’un intervalle de variable situé entre MinPollInterval et MaxPollInterval, afin de déterminer la fréquence d’interrogation de la source de temps. SpecialPollInterval doit être compris dans la plage [MinPollInterval, MaxPollInterval], sinon, la valeur la plus proche est choisie. Valeur par défaut : 1024

EventLogFlags
Cette valeur est un masque de bits qui gère les événements pouvant être consignés dans le journal système de l’Observateur d’événements. Définir cette valeur sur 0x1 signifie que W32time crée un événement dès qu’un décalage de temps est détecté. Définir cette valeur sur 0x2 signifie que W32time crée un événement dès qu’un changement de source de temps est détecté. Puisqu’il s’agit d’une valeur de masque de bits, définir la valeur sur 0x3 (addition de 0x1 et de 0x2) signifie que les décalages de temps et les changements de source de temps sont enregistrés.

Use cases

Sets the Windows NTP client parameters: time server (NtpServer, in "name,flags" form; default time.windows.com,0x09), authentication type (NT5DS by default) and special poll interval (SpecialPollInterval: 3,600 s according to the Microsoft article, 1,024 s shown by the ADMX template). It is used to point machines or servers to a specific time source, for example an internal one.

The service is designed to work well out of the box: only change these values for a clear reason.

Microsoft source: Group Policy Settings Explained (Windows Time service)

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\W32time\TimeProviders\NtpClient
Value name
not defined in the ADMX

Enable / disable values: not defined in the ADMX (see the options below).

PowerShell

PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.

Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.

Enable

# Enable: W32Time/W32TIME_POLICY_CONFIGURE_NTPCLIENT
$k = 'HKLM:\Software\Policies\Microsoft\W32time\Parameters'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# NtpServer
Set-ItemProperty -Path $k -Name 'NtpServer' -Value '<value>' -Type String
# Type
# Possible options:
#   NoSync = NoSync
#   NTP = NTP
#   NT5DS = NT5DS
#   AllSync = AllSync
Set-ItemProperty -Path $k -Name 'Type' -Value 'NT5DS' -Type String
$k = 'HKLM:\Software\Policies\Microsoft\W32time\TimeProviders\NtpClient'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# CrossSiteSyncFlags
Set-ItemProperty -Path $k -Name 'CrossSiteSyncFlags' -Value 2 -Type DWord  # maximum 2
# ResolvePeerBackoffMinutes
Set-ItemProperty -Path $k -Name 'ResolvePeerBackoffMinutes' -Value 15 -Type DWord
# ResolvePeerBackoffMaxTimes
Set-ItemProperty -Path $k -Name 'ResolvePeerBackoffMaxTimes' -Value 7 -Type DWord
# SpecialPollInterval
Set-ItemProperty -Path $k -Name 'SpecialPollInterval' -Value 1024 -Type DWord  # maximum 131072
# EventLogFlags
Set-ItemProperty -Path $k -Name 'EventLogFlags' -Value 0 -Type DWord  # maximum 3

Disable

# Disable: W32Time/W32TIME_POLICY_CONFIGURE_NTPCLIENT
# No value is written in the "Disabled" state (nothing defined in the ADMX)

Revert to "Not configured"

# Revert to "Not configured": W32Time/W32TIME_POLICY_CONFIGURE_NTPCLIENT
$k = 'HKLM:\Software\Policies\Microsoft\W32time\Parameters'
Remove-ItemProperty -Path $k -Name 'NtpServer' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'Type' -ErrorAction SilentlyContinue
$k = 'HKLM:\Software\Policies\Microsoft\W32time\TimeProviders\NtpClient'
Remove-ItemProperty -Path $k -Name 'CrossSiteSyncFlags' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'ResolvePeerBackoffMinutes' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'ResolvePeerBackoffMaxTimes' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'SpecialPollInterval' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'EventLogFlags' -ErrorAction SilentlyContinue

Options (7)

LabelControlRegistry valueREG typeConstraints / details
NtpServerW32TIME_NtpServerText boxtextNtpServerin Software\Policies\Microsoft\W32time\ParametersREG_SZ
Default (UI): time.windows.com,0x9
TypeW32TIME_TypeDrop-down listenumTypein Software\Policies\Microsoft\W32time\ParametersREG_SZ
Default choice (UI): #2
LabelValue
NoSyncREG_SZ = NoSync
NTPREG_SZ = NTP
NT5DSREG_SZ = NT5DS
AllSyncREG_SZ = AllSync
CrossSiteSyncFlagsW32TIME_CrossSiteSyncFlagsNumeric boxdecimalCrossSiteSyncFlagsREG_DWORD
Max: 2 · Default (UI): 2
ResolvePeerBackoffMinutesW32TIME_ResolvePeerBackoffMinutesNumeric boxdecimalResolvePeerBackoffMinutesREG_DWORD
Default (UI): 15
ResolvePeerBackoffMaxTimesW32TIME_ResolvePeerBackoffMaxTimesNumeric boxdecimalResolvePeerBackoffMaxTimesREG_DWORD
Default (UI): 7
SpecialPollIntervalW32TIME_SpecialPollIntervalNumeric boxdecimalSpecialPollIntervalREG_DWORD
Max: 131072 · Default (UI): 1024
EventLogFlagsW32TIME_NtpClientEventLogFlagsNumeric boxdecimalEventLogFlagsREG_DWORD
Max: 3 · Default (UI): 0

Availability