W32tm rediscover and How do I force sync the time on Windows

Формат команды для проверки доступности NTP сервера

w32tm /stripchart /computer:доменное.имя_ИЛИ_IP.NTP.сервера /dataonly /samples:5

Проверим сервер time.windows.com

w32tm /stripchart /computer:time.windows.com /dataonly /samples:5

Я могу ошибаться, но похоже Windows Server не разрешает устанавливать несколько NTP серверов через GUI.

К счастью я нашёл отличный .bat’ник на github

@echo on & @setlocal enableextensions
@echo =========================
@echo Turn off the time service
net stop w32time
@echo ======================================================================
@echo Set the SNTP (Simple Network Time Protocol) source for the time server
w32tm /config /syncfromflags:manual /manualpeerlist:"time.cloudflare.com time.google.com time.windows.com ntp.ripe.net"
@echo =============================================
@echo ... and then turn on the time service back on
net start w32time
@echo =============================================
@echo Tell the time sync service to use the changes
w32tm /config /update
@echo =======================================================
@echo Reset the local computer's time against the time server
w32tm /resync /rediscover
@endlocal & @goto :EOF

Для наглядности я ввёл все команды из примера выше вручную

W32tm rediscover and How do I force sync the time on Windows

Теперь можно посмотреть список наших NTP серверов (/peers: отображение списка узлов и их состояние)

w32tm /query /peers

W32tm rediscover and How do I force sync the time on Windows

Посмотреть статус синхронизации с NTP (/status: отображение состояния службы времени Windows)

w32tm /query /status

W32tm rediscover and How do I force sync the time on Windows

Посмотреть конфигурацию NTP (/configuration: отображение конфигурации времени выполнения и места, где берется параметр).

w32tm /query /configuration

W32tm rediscover and How do I force sync the time on Windows

Ещё несколько полезных команд.

w32tm /resync

Показать текущий часовой пояс (time zone)

w32tm /tz

Вернуть всё в default

net stop w32time
w32tm /unregister
w32tm /register
net start w32time

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies

How to sync the time to a public time server using NTP

You need to use the w32tm command.

First check the current settings :

image

What about the 0x1 parameter ?

  • 0x01 – Use special poll interval Special Interval
  • 0x02 – Use As Fall back Only
  • 0x04 – Send request as Symmetric Active mode
  • 0x08 – Send request as Client mode

To set a new External Time Server like pool.ntp.org use this command :

net stop w32time
w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:MANUAL
net start w32time
w32tm /resync

This is the configuration :

w32tm /query /configuration

image

These are all the command line switches :

w32tm /ntte <NT time epoch>
Convert a NT system time, in (10^-7)s intervals from 0h 1-Jan 1601,
into a readable format.

w32tm /ntpte <NTP time epoch>
Convert an NTP time, in (2^-32)s intervals from 0h 1-Jan 1900, into
a readable format.

w32tm /tz
Display the current time zone settings.

Now that you set the server to properly sync you can use this one as internal NTP server for other devices.

Keep in mind to set the firewall UDP 123 rules to accept.

More info see here

В этой статье рассмотрим, почему после выключения или перезагрузки ноутбука / компьютера / сервера в операционной системе могут сбрасываться текущие настройки даты и времени, указанные ранее. Рассмотрим, как самый банальный случая с севшей батарейкой BIOS, так и более интересные кейсы с мультизагрузкой Windows и Linux на одном компьютере, и багом прошивки на Windows серверах HPE ProLiant G9 /G8.

Не сохраняется время из-за севшей батарейка BIOS

Самый «классический» ответ на вопрос «Почему не сохраняется и сбивается время и дата на компьютере?» — севшая батарейка BIOS. Данная батарейка отвечает за сохранение настроек BIOS/ UEFI, когда ваш компьютер/ноутбук выключен из розетки, а также обеспечивает автономную работу встроенных аппаратных часов.

Если батарейка села, то при отключении питания материнской карты, BIOS не может сохранить свои настройки, и все они сбрасываются, в том числе и текущее дата и время. Если ваш компьютер довольно старый, вероятность того, что у вас села батарейка крайне велика. Настоятельно рекомендуем ее заменить. Сделать это не сложно, и, как правило, особых инженерных навыков процесс замены батарейки BIOS не требует. В большинстве домашних систем используется в BIOS стандартная батарейка CR2032 на 3 вольта.

bios замена старой батарейки

Если замена батарейки не помогла, проверьте состояние перемычки сброса настроек BIOS (джампер с перемычкой расположен рядом с отсеком для батарейки и может быть подписан как CCMOS / CLEAR / RESET). Возможно кто-то оставил данный джампер в положении «сброса», в результате чего при каждой подачи питания на мат.плату, настройки BIOS обнуляются. Верните джампер в нормальное положение.

Следующий вариант – обновление прошивки BIOS материнской карты (как это сделать – смотрите на сайте производителя вашего железа). Часто в более новых прошивках исправляются различные баги.

Настройки часового пояса и синхронизации времени с time. windows. com

В том случае, если у вас постоянно меняются настройки даты//времени в Windows, в первую очередь стоит проверить текущие настройки часового пояса и параметры синхронизации времени с интернетом. В Windows 10 текущие настройки времени можно посмотреть в меню панели инструментов (Панель управления\Часы, язык и регион -> Дата и время). В этом примере видно, что указан часовой пояс UTC + 03, переход на зимнее время отключен.

часовой пояс windows

Совет. Вы можете управлять часовым поясом Windows из командой строки с помощью утилиты tzutil.

Если ваш компьютер не в домене, проверьте настройки синхронизации времени с внешним источником времени (сервером времени NTP). В этом случае в этом же окне щелкните по вкладке «Время по Интернету» и проверьте, что компьютер настроен на автоматическую синхронизацию времени с сервером time.windows.com.

Совет. Напомню, что с 2014 года в России отменен переход на летнее время. Возможно вы давно не обновляли свою ОС (Windows 8 и ниже) и у вас не установлены обновления, отключающие переход на летнее время.

Синхронизация времени в домене Windows

Если ваш компьютер входит в состав домена Active Directory, то информацию о том как работает синхронизация времени в домене можно получить из этой статьи.

Сбивается время при переключении между Linux и Windows (Dual Boot)

Отдельно стоит рассмотреть конфигурации, когда на компьютере установлены две операционные системы (Windows и Linux) в конфигурации двойной загрузки (Dual Boot). Вы можете столкнуться с проблемой, что после переключения между операционными системами (загрузки в Linux после Windows) сбивается время на несколько часов вперед или назад.

Windows и Linux по разному работают с временем BIOS. Дело тут в наличии двух форматов представления времени UTC и localtime.

Операционные системы GNU/Linux (в том числе Mac OS X) считают, что время в BIOS указано в формате UTC (по Гринвичу). Соответственно, при загрузке Linux для преобразования UTC к локальному времени добавляет (отнимает) смещение текущего часового пояса, который выбрал пользователь. Т.е. чтобы получить локальное время для часового пояса Москвы UTC+3, Linux добавит 3 часа.

Windows же считает, что в время в BIOS хранится в формате localtime, и если вы указали новый часовой пояс, или синхронизировали время с внешним источником, система соответственным образом меняет время в BIOS на локальное время. Linux (Ubuntu в моем случае) считает, что время в BIOS указано в формате UTC и дополнительно добавляет смещение часового пояса. Именно поэтому и сбивается время при переключении между Linux и Windows.

Чтобы исправить такую ситуацию, нужно переключить Windows на использование времени в формате UTC с помощью параметра реестра RealTimeIsUniversal.

reg add "HKLMACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /t REG_DWORD /d 1 /f

RealTimeIsUniversal

Совет. В 64 битных версиях Windows нужно создавать параметр типа QWORD вместо DWORD:
reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_QWORD /d 1

Также в Windows нужно отключить обновление времени из Интернета, т.к. служба времени Windows при каждом обновлении времени будет сбрасывать UTC время на локальное.

sc config w32time start= disabled

Осталось перезагрузить Windows.

Либо можно переключить Linux на использование локального времени. В Ubuntu 15.04 и выше и CentOS это можно сделать командой timedatectl:

timedatectl set-local-rtc 1

Сбивается время после перезагрузки на серверах HP с Windows Server

На серверах HPE DL/ML Gen9 с Windows Server 2008 R2 / 2012 R2 у одного из удаленных заказчиков столкнулись с интересной проблемой после смены часового пояса. Как оказалось, на серверах HP ProLiant Gen9 (и на одном из серверов HP ProLiant DL580 Gen8) при изменении системного времени или часового пояса, после перезагрузки сервера, системное время не сохранялось и сбрасывалось на предыдущее. Проблема были подвержены сервера, в которых Windows Server загружается в режиме Legacy (при нативной UEFI загрузки проблемы отката времени не было).

:/>  Нету открыть с помощью windows 10

В журнале системы при этом появлялось такое событие:

The system time has changed to ‎2018‎-‎04‎-‎29T12:12:28.500000000Z from ‎2018-‎04‎-‎29T13:12:27.923115700Z.
Change Reason: System time synchronized with the hardware clock.

В качестве решения проблемы HP предлагает обновить ROM до версии не менее 1.5. Именно в этой версии ROM-Based Setup Utility (RBSU) не подвержена багу со сбросом временм.

Либо в качестве обходного решения, можно указать, чтобы Windows считала, что BIOS отдает ей системное время в формате UTC (а не локальное время). Для этого, как мы уже говорили выше нужно создать в ключе реестра HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation параметр с именем RealTimeIsUniversal и значением 1.

Служба времени Windows, несмотря на кажущуюся простоту, является одной из основ, необходимых для нормального функционирования домена Active Directory. В правильно настроенной среде AD служба времени работает следующим образом: компьютеры пользователей получают точное время от ближайшего контроллера домена, на котором они зарегистрировались. Все контроллеры домена в свою очередь получают точное время от DC с FSMO ролью «Эмулятор PDC», а контролер PDC синхронизирует свое время с неким внешним источником времени. В качестве внешнего источника времени может выступать один или несколько NTP серверов, например time.windows.com или NTP сервер вашего Интернет-провайдера. Также нужно отметить, что по умолчанию клиенты в домене синхронизируют время с помощью службы времени Windows (Windows Time), а не с помощью протокола NTP.

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

В первую очередь выберите подходящий NTP сервер, который вы могли бы использовать. Список общедоступных NTP серверов доступен на сайте . В нашем примере мы будем использовать NTP сервера из пула ru.pool.ntp.org:

  • 0.ru.pool.ntp.org
  • 1.ru.pool.ntp.org
  • 2.ru.pool.ntp.org
  • 3.ru.pool.ntp.org

Настройка синхронизации времени в домене с помощью групповых политик состоит из двух шагов:

1) Создание GPO для контроллера домена с ролью PDC
2) Создание GPO для клиентов (опционально)

Настройка политики синхронизации NTP на контролере домена PDC

Этот шаг предполагает настройку контроллера домена с ролью эмулятора PDC на синхронизацию времени с внешним NTP сервером. Т.к. теоретически роль эмулятора PDC может перемещаться между контроллерами домена, нам нужно сделать политику, которая применялась бы только к текущему владельцу роли PDC. Для этого в консоли управления Group Policy Management Console (GPMC.msc), создадим новый WMI фильтр групповых политик. Для этого в разделе WMI Filters создадим фильтр и именем PDC Emulator и WMI запросом:
Select * from Win32_ComputerSystem where DomainRole = 5

W32tm rediscover and How do I force sync the time on Windows

Затем создайте новую GPO и назначьте ее на контейнер Domain Controllers.

W32tm rediscover and How do I force sync the time on Windows

Нас интересуют три политики:

  • Configure Windows NTP Client: Enabled (настройки политики описаны ниже)
  • Enable Windows NTP Client: Enabled
  • Enable Windows NTP Server: Enabled

W32tm rediscover and How do I force sync the time on Windows
В настройках политики Configure Windows NTP Client укажите следующие параметры:

  • NtpServer: 0.ru.pool.ntp.org,0x1 1.ru.pool.ntp.org,0x1 2.ru.pool.ntp.org,0x1 3.ru.pool.ntp.org,0x1
  • Type: NTP
  • CrossSiteSyncFlags: 2
  • ResolvePeerBackoffMinutes: 15
  • Resolve Peer BAckoffMaxTimes: 7
  • SpecilalPoolInterval: 3600
  • EventLogFlags: 0

Совет. Не забудьте настроить межсетевой экран таким образом, чтобы сервер PDC мог получить доступ к внешним NTP серверам по протоколу NTP (UDP порт 123).

W32tm rediscover and How do I force sync the time on Windows

Примечание. Обратите внимание на синтаксис в поле NtpServer. Формат указания нескольких NTP серверов такой:ntsrv1.org,0x1 ntpsrv2.org,0x1 (разделитель пробел). На скриншоте указаны ошибочные данные!

Примените созданный ранее фильтр PDC Emulator к данной политике.

W32tm rediscover and How do I force sync the time on Windows

Совет. Найти имя сервера с ролью PDC можно с помощью команды:
netdom query fsmo

Осталось обновить политики на контроллере PDC:
gpupdate /force

Вручную запустите синхронизацию времени:
w32tm /resync

Проверьте текущие настройки NTP:
w32tm /query /status

Совет. В том случае, если время не синхронизировалось, перезапустите службу времени Windows и сбросьте текущие настройки:
net stop w32time
w32tm.exe /unregister
w32tm.exe /register
net start w32time

Настройка синхронизации времени на клиентах домена

В среде Active Directory по умолчанию клиенты домена синхронизируют свое время с контролерами домена (опция Nt5DS – синхронизировать время согласно иерархии домена). Как правило, эта схема работает и не требует перенастройки. Однако при наличии проблем с синхронизацией времени на клиентах домена, можно попробовать принудительно назначить сервер времени для клиентов с помощью GPO.

В качестве сервера NTP укажите имя или ip адрес PDC, например msk-dc1.winitpro.ru,0x9, а в качестве типа синхронизации — NT5DS

W32tm rediscover and How do I force sync the time on Windows

Обновите настройки групповых политик на клиентах и проверьте, что клиенты успешно синхронизировали свое время с PDC.

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

Вы можете столкнуться с ошибкой синхронизации времени в Windows, когда ваш компьютер не может автоматически синхронизировать свое время с серверами времени time.microsoft.com в Интернете. Из-за некорректного времени на компьютере у вас может возникать ошибка «
Your clock is ahead/ Ваши Часы спешат (отстают)
» при открытии HTTPS сайтов Chrome (и в других браузерах), не корректно работать сторонние программы, и появляться различные другие неприятности.

Если попытаться вручную выполнить синхронизацию времени из панели управления Windows (Control Panel -> Date and Time -> Internet Time -> Change Settings -> Update now), появляется ошибка:

An error occurred while windows was synchronizing with time.windows.com. The peer is unreachable.

Также здесь может быть ошибка:

The peer is unresolved.

ошибка синхронизации времени с интернетом в windows

Проверьте, что у вас настроена автоматическая синхронизация времени с NTP серверами в Интернете. Перейдите в раздел Settings -> Time and Language -> Date and Time (можно перейти в этот раздел с помощью команды быстрого доступа по URI:
ms-settings:dateandtime
). Проверьте, что здесь включена опцию Set time automatically и выполните синхронизацию, нажав кнопку Sync now в разделе Additional settings.

включить синхронизацию времени

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

w32tm /query /peers

w32tm /query /peers вывести источник времени

По умолчанию компьютеры в рабочих группах (не присоединенные к домену Active Directory) настроены на получение времени с серверов time.windows.com.

Restart-Service -Name w32time

Если служба отключена, включите ее.

проверить службу времени в Windows (w32time)

Проверьте, что с вашего компьютера доступен хост time.microsoft.com.

проверить доступность time.windows.com

Если ваш компьютер не может отрезолвить это имя в IP адрес (ошибка синхронизации времени The peer is unresolved), значит в настройках сетевого адаптера вашего компьютера указан DNS сервер, который не доступен, или изолирован от интернета. Попробуйте сменить адрес первичного DNS сервера на DNS сервер Google (8.8.8.8). Можно изменить настройки DNS для сетевого адаптера в Windows с помощью PowerShell.

Вывести список сетевых интерфейсов:

вывести сетевые интерфейсы компьютера

Изменить настройки DNS для сетевого адаптера с ifIndex 10:

Set-DNSClientServerAddress –InterfaceIndex 10 –ServerAddresses 8.8.8.8

Проверьте доступность сервера с помощью ping:

w32tm /stripchart /computer:time.windows.com

w32tm /stripchart - проверить время на внешнем NTP сервере

Если команда вернет ошибку error: 0x800705B4, значить указанный NTP сервер не доступен. Проверьте, что в Windows открыт исходящий порт UDP/123 для протокола NTP (по умолчанию порт должен быть открыт). Вы можете принудительно открыть порт в Windows Defender Firewall с помощью PowerShell:

New-NetFirewallRule -DisplayName "AllowOutNTP" -Direction Outbound -Protocol UDP -RemotePort 123 -Action Allow
Enable-NetFirewallRule -DisplayName AllowOutNTP

Также убедитесь, что исходящий NTP трафик не блокируется на сетевом уровне (провайдера, вашего файервола или другими сетевыми устройствами).

Если этот NTP сервер не доступен, вы можете использовать другой NTP сервер.

Можно указать
time.nist.gov
или ближайший к вам NTP сервер, который можно получить на сайте
https://www.ntppool.org
.

Можно изменить адрес вашего NTP сервера с помощью командной строки:

w32tm /config /manualpeerlist:time.nist.gov,0x1 /syncfromflags:manual /reliable:yes /update

Перезапустите службу времени (в данном примере вы запустим несколько команд в одну строку):

net stop w32time && net start w32time

Затем выполните синхронизацию времени:

w32tm /config /update
w32tm /resync

Проверьте, что ваш компьютер успешно получил время с нового источника времени (NTP сервера):

w32tm /query /status

w32tm /query /status - проверить синхронизацию времени

Если ничего не помогло, попробуйте полностью сбросить настройки службы Windows Time:

net stop w32time
w32tm /unregister
w32tm /register
net start w32time

Выполните синхронизацию времени:

Также вы можете добавить NTP сервер в список серверов времени и выполнить синхронизацию из панели управления Windows. Перейдите в Settings -> Time & language -> Date & time -> Additional clocks –> Internet Time

:/>  Как сделать чтобы все загружалось на диск d

Убедитесь, что включена опцию Synchronize with an Internet time, добавьте новый сервер time.nist.gov и нажмите кнопку Update Now.

список NTP серверов в Windows

Вы можете добавить NTP сервера в этот список через реестр HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers.

ntp сервера в реестра windows

Для автоматической синхронизации времени в Windows используется отдельно задание в планировщике Task Scheduler. Запустите консоль taskschd.msc и перейдите в раздел Task Scheduler (Local) -> Task Scheduler Library -> Microsoft -> Windows -> Time Synchronization. Проверьте, что задание SynchronizeTime включено.

задание планировщика SynchronizeTime

Также вы можете проверить состояние задания Task Scheduler с помощью PowerShell:

Чтобы включить его:

What is the command to sync a Windows workstation or server to its configured time source?

Nathan Hartley's user avatar

asked Jul 27, 2011 at 21:47

Kyle Brandt's user avatar

Kyle Brandt

73 gold badges304 silver badges444 bronze badges

There is also net time which is an older version but perhaps easier.

answered Jul 27, 2011 at 21:52

Seanchán Torpéist's user avatar

For those that still asking this question.

  1. To update, use the command below (2008 and 2012 server compatible)

    w32tm /config /manualpeerlist:"ntp_server" /syncfromflags:manual /reliable:yes /update

change the ntp_server with your source

  1. Restart the time service

    net stop w32time
    net start w32time
  2. Resync the time

    w32tm /resync
  3. Verify your sync status

    w32tm /query /status

Commands above should be fine if your sources are working correctly and/or your connection is OK (firewall or Microsoft Forefront can be an issue also). The commands below can help with troubleshooting

To list out peers

w32tm /query /peers

To list out NTP Sources:

w32tm /query /source

sebix's user avatar

2 gold badges27 silver badges45 bronze badges

answered Jul 28, 2015 at 7:27

user3011708's user avatar

answered Jul 27, 2011 at 21:47

Kyle Brandt's user avatar

Kyle Brandt

73 gold badges304 silver badges444 bronze badges

  • change your time server
w32tm /config /manualpeerlist:"0.pool.ntp.org 1.pool.ntp.org" /syncfromflags:manual /update
  • fore update time
w32tm /resync /force

answered Jun 15, 2021 at 2:34

user5723841's user avatar

OS: MS Windows 7

All above ideas have been tried but did not help. The original problem still exists: “The computer did not resync because the required time change was too big.

Solution is found in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\w32time\Config

  • change this if the local time is in a hurry (e.g. 31-Dec-2050):
    MaxNegPhaseCorrection
  • change this if the local time is delayed (e.g.
    1-Jan-1980): MaxPosPhaseCorrection
  • The default values are 0xD2F0 (i.e. 54000 sec. = 15 hours)

I use this simple win_clock_sync.bat file from Start Menu StartUp:

echo off
echo Sync computer time from internet
echo.
echo Back-up registry w32time\Config
reg export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\w32time\Config exported_w32time.reg /y
rem changing the registry keys temporarly:
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\w32time\Config /v MaxNegPhaseCorrection /d 0xFFFFFFFF /t REG_DWORD /f
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\w32time\Config /v MaxPosPhaseCorrection /d 0xFFFFFFFF /t REG_DWORD /f
echo.
echo w32tm /config /update
w32tm /config /update
echo.
echo w32tm /resync /rediscover
w32tm /resync /rediscover
echo.
echo Restore registry w32time\Config
reg import exported_w32time.reg

answered May 13, 2017 at 13:36

Akos's user avatar

1 silver badge2 bronze badges

Powershell one liner if ntp server is configured:

You can put this .bat file in the startup if you CMOS batery failed so it can resync upon OS start:

@powershell -NoProfile -Command 'gsv w32time | sasv; w32tm /resync /force'

GAThrawn's user avatar

3 gold badges20 silver badges38 bronze badges

answered Aug 6, 2016 at 13:18

majkinetor's user avatar

4 silver badges9 bronze badges

Based on my research, I bookmarked this:

  1. If Hyper-v host server is a part of the same domain, disable time sync for PDC guest vm

  2. On PDC(or any single workstation), update from quoted internal DNS or ip untrusted address(0x8):

    W32tm /config /manualpeerlist:”192.168.0.254,0×8″ /syncfromflags:manual /reliable:yes /update

    Powershell Restart-Service w32time

    W32tm /resync /nowait

  3. on dc that is not PDC:

    w32tm /config /syncfromflags:domhier /update

    W32tm /resync /rediscover

  4. On servers and other stations for update time only, not config:

    W32tm /resync /nowait

  5. Check that time is really updating(difference ):

    w32tm /stripchart /computer:192.168.0.254 /samples:15 /dataonly

  6. if time service broken or failed and need reset:

    Powershell Stop-service w32time
    W32tm /unregister
    Timeout 30
    W32tm /register
    Powershell Start-service w32time

Note: NTP port is 123 UDP and should give the same output on any healthy computer

Powershell Get-NetUDPEndpoint -LocalPort 123
LocalAddress LocalPort
------------ ---------
:: 123
0.0.0.0 123

Other commands
w32tm /query /status
w32tm /query /peers
w32tm /query /configuration

Best practice from ms: Time Sync best practices

answered Nov 4, 2020 at 13:53

Dmytro Andronov's user avatar

w32tm /resync /force does not work, because the /force does not appear in server 2016.

net time /SET /Y does not work either, because it would have asked:

Of course, it won’t work if you are on AD.example.net, /Y just hides the question.

The steps work for me using PowerShell:

  1. Set w32time service as unreliable:
w32tm /config /reliable:no /syncfromflags:manual /update

Option /syncfromflags:manual means sync with NTP listed in peer list (i.e. external NTP), /update for notifying the time service the configuration have changed.

  1. Restart the w32time
Stop-Service w32time
Start-Service w32time
  1. Sync
w32tm /resync

This should work.

  1. If you DO need ADDC as a reliable time source, make it reliable again:
w32tm /config /reliable:yes /update
Stop-Service w32time
Start-Service w32time

answered Jul 19, 2019 at 7:36

Ding-Yi Chen's user avatar

I have a Win10 image that I can restore to a snapshot where this error message is always reproducible: "The computer did not resync because the required time change was too big."

I have tried to script a solution to this problem with no avail:

reg import nettime.reg # updates MaxPosPhaseOffset and MaxNegPhaseOffset
net start w32time
w32tm.exe /config /manualpeerlist:"pool.ntp.org",0x8 /syncfromflags:manual /reliable:no /update
w32tm.exe /query /configuration
w32tm.exe /resync /rediscover
w32tm.exe /resync /force

Neither the /reliable:no nor the MaxPosPhaseCorrection settings, nor any other commands indicated here worked immediately in a reproducible way.

After updating the registry, starting the service, updating the configuration and again restarting the service I still had to wait many minutes before I w32tm /resync /rediscover would succeed.

The time syncronization does succeed eventually, just not in a timely and reliable manner.

answered Aug 8, 2019 at 12:02

Comotion's user avatar

Nothing worked for me because “The computer did not resync because the required time change was too big.“, I ended up using node with ntp-client to set the approximated current time and then be able to resync

::time service needs to be started before changing time
net start W32Time
node.exe time_set.js
w32tm /resync
pause
const ntp_server = 'localhost'; //replace with your ntp server address
const ntp_port = 123; //replace with your ntp server port
const ntp_client = require('ntp-client');
const {exec} = require('child_process');
//get ntp time
ntp_client.getNetworkTime(ntp_server, ntp_port, (err, ntp_date) => { //exit with error code if (err) { process.exit(1); } //go back to 23:59:30 if close to midnight if (ntp_date.getHours() === 23 && ntp_date.getMinutes() === 59 && ntp_date.getSeconds() > 30) { ntp_date.setSeconds(30); } //set date exec(`date ${ntp_date.toLocaleDateString()}`, {shell: true}); //set time exec(`time ${ntp_date.toLocaleTimeString()}`, {shell: true});
});
  • This has to be run as administrator
  • This seems to work with different default regional formats. If you are setting custom date and time formats, set them after synchronizing time.
  • If you need custom date and time formats support you might need to read the formats from the registry HKEY_CURRENT_USER\Control Panel\International (most likely values sShortDate and sTimeFormat) and then manually format the date or use a tool like date-and-time

answered Apr 9, 2022 at 19:58

Dan's user avatar

The computer did not resync because the required time change was too big.

powershell> Set-Date “02/01/2023 4:20:00 PM”

Check your phone or VCR for current approximate time, Windows will be mad if the drift is +/- 5 minutes, so you have some wiggle room.

answered Feb 8 at 23:26

p0wd3r's user avatar

Try one-line command. Works all the time.

w32tm /unregister && w32tm /register && net stop w32time && net start w32time && w32tm /resync

djdomi's user avatar

3 gold badges12 silver badges19 bronze badges

answered Oct 4, 2018 at 20:11

slayernoah's user avatar

2 gold badges13 silver badges19 bronze badges

W32tm rediscover and How do I force sync the time on Windows
The Computer did not Resync because no Time Data was Available

There have been many different ways to resolve this problem over the years. We have decided to gather the best methods and include them in this article for you to check out and, hopefully, resolve the problem.

:/>  «Управление дисками с помощью cmd и DISKPART — администрирование дисков, томов и разделов с помощью командной строки Windows»

What Causes the ‘The Computer did not Resync because no Time Data was Available’ Error on Windows?

  • A group policy may be set improperly – Some group policies regarding the Windows Time Service might be in need of change.
  • A Parameter of Windows Time Service is set wrong – Changing a parameter in Windows Time Service’s registry settings should help resolve the problem.
  • General issues with the Windows Time Service – You can try running commands and/or restarting the service.

Solution 1: Change Group Policies

For a Domain Object:

  1. Open the Run dialog box by using the Windows Key + R key combination on your keyboard (press these keys at the same time). Type “dsa.msc” in the newly opened box without the quotation marks and click OK in order to open the Active Directory Users and Computers Microsoft Management Console.
W32tm rediscover and How do I force sync the time on Windows
Opening Active Directory Users and Computers MMC
  1. Inside, right-click the container which contains the Group Policy object you want to modify and choose Properties from the context menu.
  2. In the new “Container Name” Properties window which will open, navigate to the Group Policy Click the object you want to modify and choose Edit.

For a local computer:

  • Open the Run dialog box by using the Windows Key + R key combination on your keyboard (press these keys at the same time. Type “gpedit.msc” in the newly opened box without the quotation marks and click OK in order to open the Local Group Policy Editor.
W32tm rediscover and How do I force sync the time on Windows
Running Local Group Policy Editor
  1. On the left navigation pane of Local Group Policy Editor, under Computer Configuration, double click on Administrative Templates, and navigate to System > Windows Time Service.
  2. Select the Windows Time Service folder by left-clicking on it and check out its right side section.
  3. Double click the “Global Configuration Settings” policy and check the radio button next to the “Not Configured” option.
Changing the Global Configuration Settings for Windows Time Service
  1. Next, expand the Windows Time Service folder and click the Time Providers key. Inside, you will find three keys: Configure Windows NTP Client, Enable Windows NTP Client, and Enable Windows NTP Server.
  2. Double-click each entry and change the radio button at the top to Not Configured.
W32tm rediscover and How do I force sync the time on Windows
Setting Time Providers to Not Configured
  1. Apply the changes you have made before exiting. The changes won’t be applied until you restart.
  2. Finally, reboot the computer to save the changes and check to see if you are still being faced with the error.

Solution 2: Tweaking Registry Keys

Editing some specific keys in the registry should enable you to connect to the time server properly. This set of steps should be performed on the host computer of the workgroup, homegroup, or any other network with a centralized host computer. Make sure you are careful when handling the registry keys.

  1. Since you are going to delete a registry key, we recommend you check out this article we have published for you to safely backup your registry to prevent other problems. Still, nothing wrong will occur if you follow the steps carefully and correctly.
  2. Open the Registry Editor window by typing “regedit” in the search bar, the Start menu, or the Run dialog box which can be accessed with the Windows Key + R key combination. Navigate to the following key in your registry by navigating at the left pane:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
  1. Click on this key and try to locate an entry named Type. If it’s not there, create a new String Value entry called Type by right-clicking at the right side of the window and choosing New > String Value. Right-click on it, and choose the Modify option from the context menu.
Configuring the registry entry
  1. In the Edit window, under the Value data section change the value to NT5DS and apply the changes you have made. Confirm any security dialogs which may appear during this process.
  2. You can now manually restart your computer by clicking Start menu > Power button > Restart and check to see if the problem is gone. This will probably resolve the problem immediately.

Solution 3: Running Windows Time Service Command

  1. Search for “Command Prompt” either right in the Start menu or by tapping the search button right next to it. Right-click the first result which appears at the top and select the “Run as administrator” option.
W32tm rediscover and How do I force sync the time on Windows
Running Command Prompt as an Administrator
  1. Users who are using an older version of Windows can use the Windows Logo Key + R key combination in order to bring up the Run dialog box. Type in “cmd” in the box and use the Ctrl + Shift + Enter key combination in order to run Command Prompt as an administrator.
  2. Copy and paste the command shown below and make sure you click the Enter key on your keyboard.
w32tm /config /manualpeerlist:time.windows.com,0x1 /syncfromflags:manual /reliable:yes /update
  1. Check to see if the “The computer did not resync because no time data was available” problem still appears when running the ‘w32tm /resync’ command!

Solution 4: Restart the Windows Time Service

Restarting the service will restart the whole process as well but it should resolve the problem, especially if a bug was causing it to misbehave. Check it out below.

  1. Open the Run utility by using the Windows Key + R key combination on your keyboard (press these keys at the same time. Type “services.msc” in the newly opened box without the quotation marks and click OK in order to open the Services tool.
    W32tm rediscover and How do I force sync the time on Windows
    Running Services
  2. Locate Windows Time Service on the list, right-click on it and select Properties from the context menu which appears.
  3. If the service is started (you can check that just next to the Service status message), you should stop it by clicking the Stop button in the middle of the window. Anyway, run it again by clicking the Start

    W32tm rediscover and How do I force sync the time on Windows
    Starting the Windows Time Service
  4. Make sure that the option under the Startup type menu in the service’s properties window is set to Automatic before you proceed with other steps. Confirm any dialogue boxes which may appear when changing the startup type.

 “Windows could not start the service on Local Computer. Error 1079: The account specified for this service differs from the account specified for other services running in the same process.”

  1. Follow the steps 1-3 from the instructions above in order to open the service’s properties window. Navigate to the Log On tab and click on the Browse… button.

W32tm rediscover and How do I force sync the time on Windows

  1. Under the “Enter the object name to select” entry box, type in your account’s name, click on Check Names and wait for the name to become available.
  2. Click OK when you are finished and type in the password in the Password box when you are prompted with it if you have set up a password. It should now start without issues!

Photo of Kevin Arrows

Kevin Arrows

Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.