Настройка ntp клиента windows 2019

Maintaining accurate time on your server is critical largely because many services and IT applications rely on accurate time settings to function as expected. These include logging services, monitoring and auditing applications, and database replication to mention a few.

Time skew in servers, and any client systems for that matter, is undesirable and usually causes conflict in time-critical applications.  To maintain accurate time settings on your server and across the network by extension, it’s preferred to install and enable a NTP server on your server.

What is an NTP server?

NTP, short for Network Time Protocol, is a protocol that synchronizes time across network devices. It listens on UDP port 123 and always ensures that time inconsistencies across the server and client systems are mitigated and that client systems are always in sync with the server.

NTP server refers to a network device or a service that fetches time from an external time source and syncs the time across the network using the NTP protocol. This guide will focus on installing NTP service on Windows server 2019.

How Does NTP Work ?

Being a protocol, NTP requires a client-server architecture. The NTP client residing on a Windows PC, for example, initiates a time request exchange with the NTP server.

A time-stamp data exchange happens between the server and client and this helps in adjusting the clock on client’s systems to the highest degree of accuracy to match the time on the NTP server. In this guide, we will walk you through the installation and configuration of NTP server on Windows Server 2019.

There are several ways of setting up NTP server and we will look at each in turn.

In Windows Server environments, there is a special Windows time service that handles time synchronization between the server and the client systems. This is known as Windows Time service. PowerShell provides a command-line tool known as w32tm.exe and comes included in all versions of Windows from Windows XP and Windows Server 2008 to the latest versions of each OS.

Using the w32tm.exe utility, you can configure your Windows system to sync with online time servers. Usually, this is the tool of choice when setting up and monitoring time on your Windows Server system.

Using the command-line utility is quite straightforward.

For example, to set the Server to point to 2 different time servers, namely 0.us.pool.ntp.org  and  1.us.pool.ntp.org , launch  PowerShell as the Administrator and  run the command below

w32tm /config /syncfromflags:manual /manualpeerlist:”0.us.pool.ntp.org 1.us.pool.ntp.org” /update

Then restart Windows Time service using the commands:

Stop-Service w32time
Start-Service w32time

Here’s a snippet of the commands.

You can thereafter confirm the values of NTP servers configured in the registry by running this command:

w32tm /dumpreg /subkey:parameters

Configure NTP Server on Windows Server 2019 using Registry editor

The second method of installing and configuring the NTP server is using the registry editor. If you are not a fan of the Windows PowerShell, then this will truly come in handy.

To get started, open the registry editor. Press ‘Windows key + R’ and type ‘regedit’ and hit ENTER. The windows registry will be launched as shown below.

Next, head over to the path shown below

ComputerHKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpServer

On the right pane. Be sure to find & double-click the file labelled ‘Enabled’ in the diagram shown below.

Next, In the ‘value data’ text field, set the value to ‘1’ and click the ‘Ok’ button.

Next, head over to the path:

ComputerHKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfig

In the right pane, double click the ‘Announce Flags’ file.

Double-click the file and in the Value data text field, type the value ‘5’ and click ‘OK’.

For the changes to come into effect, you need to reboot the NTP server by heading to the services Window. To achieve this, press ‘Windows key + R’ and type ‘services.msc’. Scroll and find ‘Windows Time’, right-click on it and select the ‘Restart’ option.

Useful w32tm commands

Once you have set up your NTP server, you can use the following commands to verify various aspects of the server:

To check the status of the NTP server, run the command:

w32tm /query /status

To reveal the current NTP pool being used to sync time with execute:

w32tm /query /source

You can also display a list of NTP time servers along with their configuration status as shown.

w32tm /query /peers

To display NTP server configuration settings, run the command:

w32tm /query /source

This shows quite a wealth of information.

Final Take

We cannot stress enough how important it is to maintain accurate time and date settings on your server. As you have seen, setting up an NTP server on your Windows server instance is quite easy and straight forward.

Once you have configured the NTP service on your server, other domain controllers in your environment will sync with this server and the Windows clients in the domain will sync with the domain controllers. Hopefully, you can now install and configure NTP on Windows Server 2019.

If the computer is an Active Directory Domain Controller, the NTP Server feature is enabled automatically. So, the following example is for a computer that needs to enable NTP Server in a WorkGroup environment.

  • KMS activation deployment for Windows 10, Windows 8.1, Windows Server 2012 R2, Windows Server 2016
  • HOW TO INSTALL ISA SERVER ENTERPRISE 2000 — Part III

Configure NTP Server in Windows Server 2019

If the computer is an Active Directory Domain Controller, the NTP Server feature is enabled automatically. So, the following example is for a computer that needs to enable NTP Server in a WorkGroup environment.

Step 1. Run PowerShell with admin rights and configure the following:

Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. # confirm current setting (follows are default settings) PS C:UsersAdministrator> Get-ItemProperty -Path "HKLM:SYSTEMCurrentControlSetServicesw32timeTimeProvidersNtpServer" InputProvider : 0 AllowNonstandardModeCombinations : 1 EventLogFlags : 0 ChainEntryTimeout : 16 ChainMaxEntries : 128 ChainMaxHostEntries : 4 ChainDisable : 0 ChainLoggingRate : 30 RequireSecureTimeSyncRequests : 0 DllName : C:WindowsSYSTEM32w32time.DLL Enabled : 0 PSPath : Microsoft.PowerShell.CoreRegistry::HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServ icesw32timeTimeProvidersNtpServer PSParentPath : Microsoft.PowerShell.CoreRegistry::HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServ icesw32timeTimeProviders PSChildName : NtpServer PSDrive : HKLM PSProvider : Microsoft.PowerShell.CoreRegistry # enable NTP Server feature PS C:UsersAdministrator> Set-ItemProperty -Path "HKLM:SYSTEMCurrentControlSetServicesw32timeTimeProvidersNtpServer" -Name "Enabled" -Value 1 # set [AnnounceFlags] to 5 # number means # 0x00 : Not a time server # 0x01 : Always time server # 0x02 : Automatic time server # 0x04 : Always reliable time server # 0x08 : Automatic reliable time server PS C:UsersAdministrator> Set-ItemProperty -Path "HKLM:SYSTEMCurrentControlSetservicesW32TimeConfig" -Name "AnnounceFlags" -Value 5 # restart Windows Time service PS C:UsersAdministrator> Restart-Service w32Time # if Windows Firewall is running, allow NTP port PS C:UsersAdministrator> New-NetFirewallRule ` -Name "NTP Server Port" ` -DisplayName "NTP Server Port" ` -Description 'Allow NTP Server Port' ` -Profile Any ` -Direction Inbound ` -Action Allow ` -Protocol UDP ` -Program Any ` -LocalAddress Any ` -LocalPort 123 

Step 2. NTP Server Host also needs time synchronization with other Hosts as the NTP Client.

Configure NTP Client in Windows Server 2019

NTP Client settings are configured with NTP Server [time.windows.com] by default Windows, so if the computer is connected to the Internet, the date and time will be synchronized.

Furthermore, if the computer is in Active Directory Domain, the NTP Client settings are also configured as follows, so generally there is no need to change the settings:

  1. Domain Controller synchronizes time with PDC in the domain.
  2. The PDCs in a domain time synchronize with the PDCs in the Parent Domain (primary domain) or with other Domain Controllers.
  3. The client computers synchronize the time with the Domain Controller on which the client is currently logged on.

In the WorkGroup environment, you can change the default NTP server to other servers as follows.

Step 1. Run PowerShell with admin rights and configure the following:

Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. # confirm current synchronization NTP Server PS C:UsersAdministrator> w32tm /query /source time.windows.com,0x8 # change target NTP Server (replace to your timezone server) # number means # 0x01 : SpecialInterval # 0x02 : UseAsFallbackOnly # 0x04 : SymmetricActive # 0x08 : NTP request in Client mode PS C:UsersAdministrator> Set-ItemProperty -Path "HKLM:SYSTEMCurrentControlSetServicesw32timeParameters" -Name "NtpServer" -Value "ntp.nict.jp,0x8" # restart Windows Time service PS C:UsersAdministrator> Restart-Service w32Time # re-sync manually PS C:UsersAdministrator> w32tm /resync Sending resync command to local computer The command completed successfully. # verify status PS C:UsersAdministrator> w32tm /query /status Leap Indicator: 0(no warning) Stratum: 4 (secondary reference - syncd by (S)NTP) Precision: -23 (119.209ns per tick) Root Delay: 0.0252246s Root Dispersion: 0.0824040s ReferenceId: 0x85F3EEF3 (source IP: 133.243.238.243) Last Successful Sync Time: 9/23/2019 10:15:33 PM Source: ntp.nict.jp,0x8 Poll Interval: 8 (256s)

Step 2. If a computer is in an Active Directory domain environment and is a Forest Root, the synchronization target is usually configured to [Local CMOS Clock] (Hardware Clock). Then, if you want to change the setting from [Local CMOS Clock] to NTP server network, please set as follows:

Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. # in AD Domain Environment, [Type] is set to [NT5DS] PS C:UsersAdministrator> (Get-Item -Path "HKLM:SYSTEMCurrentControlSetServicesw32timeParameters").GetValue("Type") NT5DS # if target is [Local CMOS Clock] but you'd like to change it, change [Type] to [NTP] first # next, change to NTP server with the same way in [1] section PS C:UsersAdministrator> Set-ItemProperty -Path "HKLM:SYSTEMCurrentControlSetServicesw32timeParameters" -Name "Type" -Value "NTP" 

Read more

  • Deploy KMS activation on Windows Server 2008
  • Creating SSL Server 2008 Server with ISA 2006 Firewalls (Part 1)
  • How to Install, Configure, and Test Windows Server 2012 R2 Single Subnet DHCP Server
  • Instructions for setting up individual FTP Server with FileZilla
  • Set up a VPN server on Router Tomato — Part 2
  • Install Windows Server 2003 and create a backup server

Синхронизация времени в сети является важным аспектом для обеспечения корректной работы системы, особенно в предприятиях. В этой статье мы рассмотрим, как настроить сервер и клиент NTP на Windows Server 2019.

NTP (Network Time Protocol) — это протокол, который используется для синхронизации времени на компьютерах в сети. Он позволяет установить точное время, основываясь на данных от внешнего временного источника, такого как общедоступный сервер NTP.

Настройка сервера NTP на Windows Server 2019 очень проста. Вам потребуется выполнить несколько шагов. Сначала установите роль сервера времени на сервере, затем добавьте внешний временной источник и настройте параметры синхронизации.

Настройка клиента NTP на Windows Server 2019 также не требует особых усилий. Вам просто нужно указать IP-адрес сервера времени, к которому вы хотите подключиться, и настроить параметры синхронизации. После этого ваш клиент будет синхронизироваться с сервером NTP и получать точное время.

Содержание

  1. Настройка сервера NTP на Windows Server 2019
  2. Шаг 1: Установка и настройка службы NTP
  3. Настройка клиента NTP на Windows Server 2019
  4. Шаг 1: Установка и настройка службы W32Time
  5. Синхронизация времени между сервером и клиентом

Настройка сервера NTP на Windows Server 2019

Вот как настроить сервер NTP на Windows Server 2019:

  1. Установите службу времени
  2. Перед настройкой сервера NTP вам необходимо установить службу времени Windows.

  3. Откройте командную строку
  4. Перейдите в меню Пуск, найдите командную строку (cmd) и откройте ее.

  5. Запустите команду для настройки сервера NTP
  6. Введите следующую команду и нажмите Enter: w32tm /config /manualpeerlist:"pool.ntp.org" /syncfromflags:manual /reliable:yes /update

  7. Перезагрузите службу времени
  8. Введите следующую команду и нажмите Enter: net stop w32time & net start w32time

  9. Проверьте настройки
  10. Введите следующую команду и нажмите Enter: w32tm /query /configuration

    Убедитесь, что в выводе команды присутствует строка «PeerList: pool.ntp.org».

  11. Настройте синхронизацию времени
  12. Введите следующую команду и нажмите Enter: w32tm /config /update /manualpeerlist:"0.pool.ntp.org,0x8 1.pool.ntp.org,0x8 2.pool.ntp.org,0x8 3.pool.ntp.org,0x8" /syncfromflags:manual /reliable:yes

  13. Перезагрузите службу времени
  14. Введите следующую команду и нажмите Enter: net stop w32time & net start w32time

  15. Проверьте статус синхронизации времени
  16. Введите следующую команду и нажмите Enter: w32tm /query /status

    Убедитесь, что в выводе команды присутствует строка «Leap Indicator: 0 (no warning)», а также информация о синхронизации времени.

Теперь ваш сервер NTP настроен и будет предоставлять точное время всем клиентам в сети. Вы можете использовать эту настройку для синхронизации времени на других компьютерах в вашей сети, просто указав сервер NTP в качестве источника времени.

Шаг 1: Установка и настройка службы NTP

Перед началом настройки сервера и клиента NTP на Windows Server 2019 необходимо установить и настроить службу NTP. В этом разделе мы рассмотрим процесс установки и настройки NTP на сервере.

В Windows Server 2019 служба NTP представлена в виде службы времени Windows, поэтому нам необходимо установить и настроить эту службу перед использованием функций NTP.

Для установки службы времени Windows следуйте следующим шагам:

Шаг Описание
1 Откройте «Управление сервером» в «Панели управления».
2 После открытия «Управление сервером» выберите «Добавить роли и компоненты».
3 Перейдите к пункту «Службы времени Windows» и нажмите «Далее».
4 Проверьте, что установлен флажок «Службы времени Windows» и нажмите «Далее».
5 Нажмите «Установить» и дождитесь завершения установки службы времени Windows.
6 После установки откройте «Службы» в «Панели управления».
7 Найдите службу «Windows Time» в списке служб и откройте свойства службы.
8 В свойствах службы «Windows Time» установите режим запуска службы на «Автоматически».
9 После этого нажмите «Применить» и «ОК», чтобы сохранить изменения.

Теперь служба времени Windows установлена и настроена на сервере Windows Server 2019. В следующем разделе мы рассмотрим настройку сервера NTP на Windows Server 2019.

Настройка клиента NTP на Windows Server 2019

Для обеспечения точной синхронизации времени на клиентском сервере важно настроить его в качестве клиента NTP. В этом разделе мы рассмотрим подробную процедуру настройки клиента NTP на Windows Server 2019.

1. Откройте командную строку с правами администратора.

2. Введите следующую команду для добавления сервера NTP:

w32tm /config /syncfromflags:manual /manualpeerlist:"сервер_адрес" /reliable:yes /update

Здесь «сервер_адрес» — это адрес NTP-сервера, который вы хотите использовать для синхронизации времени на клиентском сервере. Вы можете указать IP-адрес или DNS-имя сервера NTP.

3. Затем введите следующую команду для запуска службы времени Windows:

net start w32time

4. Для проверки правильности настройки клиента NTP введите следующую команду:

w32tm /query /status

В выводе вы должны увидеть информацию о текущем статусе времени и источнике синхронизации. Проверьте, что источник синхронизации указывает на правильный сервер NTP.

5. Наконец, чтобы установить клиента NTP в качестве постоянного источника синхронизации, введите следующую команду:

w32tm /config /syncfromflags:domhier /update

Теперь ваш клиентский сервер должен правильно синхронизироваться со службой времени NTP на указанном сервере.

Обратите внимание, что при настройке клиента NTP на Windows Server 2019 рекомендуется использовать сервер NTP с высокой точностью и надежностью, чтобы обеспечить правильную синхронизацию времени на вашем сервере.

Шаг 1: Установка и настройка службы W32Time

Перед тем как начать настраивать сервер и клиент NTP на Windows Server 2019, необходимо убедиться, что служба W32Time установлена и настроена правильно.

Служба W32Time отвечает за синхронизацию времени на компьютерах под управлением операционной системы Windows. В Windows Server 2019 она устанавливается по умолчанию, однако может потребоваться дополнительная настройка.

Для проверки наличия службы W32Time и ее состояния необходимо выполнить следующие шаги:

  1. Откройте командную строку от имени администратора.
  2. Введите команду w32tm /query /status и нажмите Enter.

В результате выполнения команды вы увидите информацию о текущем состоянии службы W32Time, включая источник времени (NTP-сервер), с которого происходит синхронизация.

Если вы получили ошибку или информацию о несинхронизированном состоянии, необходимо выполнить установку и настройку службы W32Time следующим образом:

  1. Откройте командную строку от имени администратора.
  2. Введите команду w32tm /register и нажмите Enter. Эта команда зарегистрирует службу W32Time на компьютере.
  3. Затем введите команду net start w32time и нажмите Enter. Эта команда запустит службу W32Time.
  4. И, наконец, выполните команду w32tm /config /syncfromflags:manual /manualpeerlist:»pool.ntp.org» и нажмите Enter. Эта команда настроит службу W32Time для синхронизации с NTP-сервером pool.ntp.org, который предоставляет точное время.

После выполнения этих команд служба W32Time будет установлена и настроена правильно. Вы можете повторно выполнить команду w32tm /query /status, чтобы убедиться, что служба работает без ошибок и синхронизируется с выбранным NTP-сервером.

Теперь, когда служба W32Time настроена правильно, вы можете приступать к настройке сервера и клиента NTP на Windows Server 2019.

Синхронизация времени между сервером и клиентом

Для обеспечения правильной работы сети и приложений на сервере и клиенте необходима синхронизация времени. Синхронизированное время позволяет устанавливать правильную последовательность событий, синхронизировать лог-файлы и устранять проблемы, связанные с расхождением времени.

Windows Server 2019 предлагает встроенную службу NTP (Network Time Protocol), которая позволяет обеспечить точную синхронизацию времени между сервером и клиентом. Настройка NTP на сервере и клиенте является относительно простой задачей и состоит из нескольких шагов.

Шаг 1: Настройка сервера NTP

1. Запустите командную строку от имени администратора.

2. Введите следующую команду для установки сервера NTP:

w32tm /config /manualpeerlist:»time.windows.com» /syncfromflags:manual /reliable:yes /update

Обратите внимание, что «time.windows.com» является временным сервером NTP, предоставляемым Microsoft.

3. Запустите службу NTP с помощью следующей команды:

net start w32time

Шаг 2: Настройка клиента NTP

1. Откройте командную строку от имени администратора.

2. Введите следующую команду для настройки клиента NTP:

w32tm /config /syncfromflags:domhier /update

Эта команда настраивает клиент таким образом, чтобы он синхронизировался со своим доменным контроллером.

3. Запустите службу NTP с помощью следующей команды:

net start w32time

После выполнения этих шагов сервер и клиент будут синхронизировать время с помощью NTP и быть точно настроенными. Это позволит избежать проблем, связанных с расхождением времени и обеспечит более стабильную работу сети и приложений.

В этом видео мы изучим протокол NTP и настроем его на Windows Server 2019.




  • Виктор Черемных



  • 13 июля, 2021



  • No Comments

Добавить комментарий

Группа в VK

Обнаружили опечатку?

Сообщите нам об этом, выделите текст с ошибкой и нажмите Ctrl+Enter, будем очень признательны!

Свежие статьи

Облако меток

Похожие статьи

Резервное копирование и восстановление данных при помощи компонента Windows Server Backup

Установка службы Windows Server Update Services на Windows Server 2019

Мониторинг ресурсов и служб в Windows

Мониторинг ресурсов и служб в Windows

В этом видео мы научимся пользоваться программами для мониторинга ресурсов Windows, сведений о системе, а также познакомимся со службами Windows. Монитор ресурсов — инструмент, позволяющий

Настройка локальной политики безопасности в Windows

Network Time Protocol (NTP) runs on the Transport Layer port 123 UDP and enables accurate time synchronization for network computers. This irons out time inconsistencies on servers and clients during file logging or replication of server databases among other resources.

In this article, we’ll outline the process of installing, configuring, and querying an NTP server on Windows Server 2019.

NTP Server

NTP servers utilize the Network Time Protocol to send time signals to servers across the globe upon request. NTP servers use the Universal Time Coordinated (UTC) time source for time signal synchronization.

The main purpose of NTP servers is to provide time synchronization for servers and computer networks with other major network servers and clients across the globe. In turn, this streamlines communications and transactions all over the world.

Installing and Configuring an NTP Server on Windows Server 2019

The process of installing, configuring, and querying an NTP Server on Windows Server 2019 is quite straightforward.

Set the NTP service to Automatic option

To start off, Hit Windows Key + R to launch the Run dialogue. Next, type services.msc and hit ENTER.

In the ‘Services’ window, locate the service ‘Windows Time’. Right-click and select the ‘Properties’ option as shown:

On the pop-up window, select the Startup type as ‘Automatic’.

Finally, click on ‘OK’ and then ‘Apply’.

Configuring NTP Server using Registry Editor

As before, launch the run dialogue by pressing Windows Key + R. Then type ‘regedit’ and hit ENTER.

The Registry editor will be launched as shown:

Navigate to the path shown below:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer

On the right pane, locate and double-click the ‘Enabled’ file as shown:

Set the Value data to 1 and click OK.

Next, follow this path.

Computer>HKEY_LOCAL_MACHINE>SYSTEM>CurrentControlSet>Services>W32Time>Config

At the right pane locate the ‘Announce Flags’ file.

Double click on the file and set its value to 5 in the ‘Value Data’ section.

Finally, reboot the NTP server for the changes to take place. Head back to the services Window, right-click on ‘Windows Time’ and select ‘Restart

Configuring NTP Server on Windows 2019 using Windows PowerShell

If you love working in Powershell, launch Powershell as Administrator and enable NTP server using the command:

Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer” -Name “Enabled” -Value 1

Next, configure Announce Flags value as shown:

Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Config” -Name “AnnounceFlags” -Value 5

Finally, restart the NTP server using the command:

Restart-Service w32Time

Important Note: UDP port 123 must be open for the NTP server traffic to reach your Windows Server 2019. If the NTP servers are unreachable, you can check your firewall settings to fix this.

Other useful commands

  1. w32tm /query /configuration to check and shows the NTP server configuration.
  2. w32tm /query /peers for checking the list of NTP servers configured alongside their configuration status
  3. w32tm /resync /nowait to force-synchronize time with your NTP server.
  4. w32tm /query /source to show the source of the time.
  5. w32tm /query /status to reveal NTP time service status.

Final take

Now your Windows Server 2019 clock is synchronized with time the NTP server’s pool.ntp.org and works as NTP client. You can achieve full network and accompanying infrastructure time synchronization by synchronizing all network workstations, servers, routers, hubs, and switches.

Since NTP servers operate over the UDP protocol using TCP/IP, these network infrastructures must be working efficiently for effective NTP server operation. In case you want to make time servers on windows server 2019 hosted on a virtual machine, you should disable the virtual machine time synchronization settings and sync their time with the domain Windows Server 2019.

  • Настройка ntp server на windows server 2019
  • Настройка rds windows server 2016
  • Настройка ntp server windows server 2012 r2
  • Настройка punto switcher для windows 10
  • Настройка rdp через интернет windows server