What is the command to sync time with domain controller?

Home  »  Blog   »   Sync your Domain with an Internet time server

Recently, the time on all of my domain computers was out of sync. Each computer in my domain had the same time, but it was about 10 minutes slow. Domain computers get their time from your domain controller(s), so I looked into syncing the time of my DC with an internet time server. The steps below can be used to sync your DC with an internet time server.

To synchronize the domain controller with an external time source

  1. Click Start, and then click Command Prompt.
  2. In the Command Prompt window, type the following line, where peers is a comma-separated list of IP addresses of the appropriate time sources, and press ENTER:
    w32tm /config /manualpeerlist: peers /syncfromflags:MANUAL
  3. The time sources you choose depend on your time zone. For example, if your domain controller is located in the Pacific Time zone, this line might read:
    w32tm /config /manualpeerlist:131.107.1.10 /syncfromflags:MANUAL
  4. In this example, the IP address of the timeserver is used instead of the fully qualified domain name for security purposes.
  5. Press ENTER. You should get a message that the command completed successfully.
  6. Type w32tm /config /update
  7. Press ENTER. You should get a message that the command completed successfully.
  8. W32time uses a variable poll interval based on the quality of timesync with the server. On DCs, this interval defaults to between 64 and 1024 seconds.
  9. To immediately synchronize with the external time server, type w32tm /resync and press ENTER. You should get a message that the command completed successfully.
  10. Type Exit and press ENTER.

Someone found the above steps on Technet, although a brief search of my own could not find an article with the exact same steps. The article below does discuss configuring the time source for your forest.

http://technet.microsoft.com/en-us/library/cc794937(WS.10).aspx

In step #3 above, you can change the IP address to reflect a server in your area/time zone. The example IP used was a National Institute of Standards and Technology (NIST) Internet Time Service (ITS) server. (Wow that was a mouthful!) To find an NIST server in your time zone visit the following link:

http://tf.nist.gov/tf-cgi/servers.cgi

Post navigation

From time to time, Windows might show the wrong time. This is especially true when you are dual booting or some program is changing the time without informing the admin. If that ever happens to you, you can force sync Windows time with a single command. Let me show you how.

To use the Windows time sync command, you need admin privileges. If you don’t have admin privileges, use the second alternative method.

To force sync time in Windows, you use the below command.

w32tm /resync

Steps to Force Sync Time with Command Line

  1. Open the Start menu,
  2. Search for “Command Prompt“.
  3. Right-click on the result and select “Run as administrator“.
  4. Type “w32tm /resync” and press Enter.

As soon as you press the Enter button, Windows will execute the time sync command. This will force Windows to show the correct time.

Detailed Step by Step Guide

First, open the start menu, search for “Command Prompt“, right-click on the result and select “Run as Administrator” option. Doing so will open the Command Prompt with admin rights.

What is the command to sync time with domain controller?

In the Command Prompt window, execute the w32tm /resync command.

As soon as you execute the command, Windows will resync the time according to your current timezone. The time details are updated from the default time.windows.com server (Windows Internet Time Server).

What is the command to sync time with domain controller?

Command to Sync Time with Domain Controller

If your Windows system in on a domain then use the w32tm /domain command.

What is the command to sync time with domain controller?

When executing the command, sometimes you might see “The computer did not resync because no time data was available” error. This is fairly common. Especially in Windows 7 and 8. Just execute the command multiple times and it should work.

Use Custom Time Server to Sync Time

Like I said before, Windows uses time.windows.com as the default time server. If that time server is not working for you or if you want to use some other custom time server, you can do that too.

Open the command prompt as admin and execute the following command.

w32tm /config /update /manualpeerlist:time.server.url.com

Don’t forget to replace time.server.url.com with the actual time server URL. You can use the NTP Pool Project to find the time server addresses of different countries and places.

As soon as you execute the command, Windows will access that time server, gets the time and syncs it with your system.

Sync Time Using Settings App

As an alternative, you can also sync the time using the Settings app. In fact, compared to the command prompt or the control panel, the new options in the Settings app are far easier to access and use.

1. First, press “Windows Key + I” to open the Settings app.

2. Go to the “Time & Language → Date & Time” page. On the right-panel, click on the “Sync” button under the Synchronize your clock section.

What is the command to sync time with domain controller?

As soon as you click the button, the PC will sync the time with the default Windows time server.

The settings app won’t allow you to change the default time server. If you use a custom time server then you have to follow the Command Prompt method shown above.

Wrapping Up

I hope that helps. If you are stuck or need some help, comment below and I will try to help as much as possible. If you are dual-booting Windows with some Linus distro then Windows and Linux may show different times for other reasons. Follow the linked post to fix that issue.

What is the time sync command?

At the command prompt, enter: w32TM /config /syncfromflags:manual /manualpeerlist:ntp.indiana.edu. Enter: w32tm /config /update. Enter: w32tm /resync. At the command prompt, enter exit to return to Windows.

Where does domain controller sync time?

By default, all computers and devices on a domain synchronize system time using the domain hierarchy. Domain members synchronize time with domain controllers, which in turn synchronize time with the domain controller running the PDC emulator role.