# Synchronizing Active Directory with External Time Source

Synchronize Active Directory with an external time source to keep domain time accurate and avoid authentication or replication issues.

blog

24 Jan 2018 es

![Synchronizing Active Directory with External Time Source](/wp-content/uploads/2016/08/activedirectory.png)

[Ver imágenes (2)](#pf-content-image-1-0)

One of the crucial parts in modern IT world is proper time and date. While it may seem that 30 seconds or even 5 minutes is not a big deal it actually matters. Modern certificates, systems and many security features require proper time verification. In **Active Directory** based environment all computers, servers are by default to sync time from main **domain controller**. While this is great it also means main domain controller actually has to to have proper time. And this is where you need to make sure it's always up to date. Solution to this is **synchronizing active directory with external time source**.

### ✅ Solution

To make sure your Primary Domain Controller (PDC) is always up to date when it comes to time you have to:

- Find your PDC (I assume you know one, but just in case…)

```plain
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().RootDomain.PdcRoleOwner.Name
```

- Find out your current configuration

```plain
# Get current time settings
w32tm /query /status
```

- Change your time settings to multiple trusted NTP servers:

```plain
# Set time settings
w32tm.exe /config /manualpeerlist:"0.europe.pool.ntp.org 1.europe.pool.ntp.org 2.europe.pool.ntp.org 3.europe.pool.ntp.org" /syncfromflags:manual /reliable:YES /update

# Update configuration
w32tm.exe /config /update

# Restart Time service
Restart-Service w32time
```

- Verify if the settings were updated properly. If the answer is incorrect try multiple times. It may take a moment or two to process things.

```plain
# Get current time settings
w32tm /query /status
```

[!\[PowerShell ISE script configuring the domain time source with Europe NTP pool servers and restarting the Windows Time service.\](/wp-content/uploads/2018/01/img_5a68b523d9f8c.png)](/wp-content/uploads/2018/01/img_5a68b523d9f8c.png)

- Finally confirm output

```plain
PS C:\Windows\system32> w32tm /query /status
Leap Indicator: 0(no warning)
Stratum: 3 (secondary reference - syncd by (S)NTP)
Precision: -6 (15.625ms per tick)
Root Delay: 0.0418354s
Root Dispersion: 7.8054506s
ReferenceId: 0x8AC9876C (source IP:  138.201.135.108)
Last Successful Sync Time: 1/24/2018 5:10:56 PM
Source: 2.europe.pool.ntp.org
Poll Interval: 6 (64s)
```

[!\[w32tm query output confirming the server is synchronized with 2.europe.pool.ntp.org as the external time source.\](/wp-content/uploads/2018/01/img_5a68b2b076e94.png)](/wp-content/uploads/2018/01/img_5a68b2b076e94.png)

If you're located elsewhere it's quite easy to find multiple other NTP sources such as US based: **“0.us.pool.ntp.org 1.us.pool.ntp.org 2.us.pool.ntp.org 3.us.pool.ntp.org”**

## Proyectos relacionados

Proyectos que encajan con las etiquetas, categorías y contenido de este artículo.

[Todos los proyectos](/es/proyectos/)

Buscando proyectos relacionados...

[Volver al blog](/blog)

## Artículos relacionados

- [Mastering Active Directory Hygiene: Automating Stale Computer Cleanup with CleanupMonster](/es/blog/mastering-active-directory-hygiene-automating-stale-computer-cleanup-with-cleanupmonster/)
- [Report Active Directory Accounts that are Synchronized with Azure AD](/es/blog/report-active-directory-accounts-that-are-synchronized-with-azure-ad/)
- [Strengthening Password Security in Active Directory: A PowerShell-Powered Approach](/es/blog/strengthening-password-security-in-active-directory-a-powershell-powered-approach/)

<!-- PowerForge markdown artifact sha256:120D659B9F90CF4D0A55FFE255E642E6598F2962A49C2D47C6BFB05853576E85 -->
