Time Synchronization (Sincronização de horário no Windows)

How to fix Time Synchronization among workstations and servers?

Within the last 90 days, I faced 3 problems regarding Time Synchronization. The last one was today so, due to this I’ve decided to share with you guys, some ways to fix this issue that looks easy but it can cause a headache to SysAdmins.

Nos últimos meses peguei 3 problemas relacionados a Time Syncronization. O último foi hoje e em virtude disso, resolvi compartilhar algumas maneiras de corrigir este problema que parece simples, mas ocasiona uma dor de cabeça para os Administradores de Rede.

  • First of all, run the command below to check from which server a workstation is getting the time/date.
  • Primeiramente, execute o comando abaixo para verificar de qual servidor, uma workstation ou server está sincronizando o horário:

w32tm /query /source

By default, workstations and servers get the time from the DC which hosts the role PDC Emulator.

Por padrão, os computadores e servidores pegam o horário do DC que hospeda a role PDC Emulator

  • To check when was the last sync and other informations, run:
  • Para verificar quando foi a última sincronização e demais informações, execute:

w32tm /query /status

  • If necessary to change the NTP server, run:
  • Se for necessário alterar o servidor NTP, execute o comando:

net time \\server /set /yes

  • The follow steps is to set one or more external NTP (on PDC Emulator)
  • O procedimento abaixo é para apontar um NTP externo (PDC Emulator)

net stop w32time

w32tm /config /manualpeerlist:a.ntp.br,b.ntp.br,c.ntp.br,0x8, /syncfromflags:manual

net start w32time

After that, we will have some external NTPs set to sync the time.

Bom, com isso teremos alguns NTPs externos definidos para sincronizar o horário.

  • To force a refresh/sync, that’s the command:
  • Para forçar um refresh/sincronização, o comando é:

w32tm /resync /rediscover

or / ou

w32tm /resync

  • In order to check the time of DCs of a domain, run the command below:
  • Para verificar o horário dos DCs de um domínio, o comando é o seguinte:

w32tm /monitor /domain:yourdomain

 

PS01: All commands must be run as Administrator

OBS01: Todos os comandos devem ser executados como Administrador

PS02: Check whether the Domain Controller is Virtual If so, uncheck on VM settings the option of time synchronization between VM and Host

OBS02: Verifique também se o Domain Controller é Virtual e caso for, desabilite nas configurações da VM a opção de sincronização de horário (entre Host e VM).

PS03: If you want to check which Time Zone is set, run the command w32tm /TZ

OBS03: Caso queira checar qual o fuso (time zone), o comando é w32tm /TZ

[ ]´s
@grvalle

Advertisement

10 thoughts on “Time Synchronization (Sincronização de horário no Windows)

  1. Muito bom o artigo. Tive um problema parecido e utilizei um servidor NTP externo.
    Porém não tinha ideia do resync.

  2. To usando o server 2012 r2, e estou c/ problemas com horario, ele a cada 20 a 30 minutos adianta em 3h o horario, esses comandos servem para esse problema?

Leave a Reply to Gustavo Valle Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s