How to Setup NTP Server on Windows Server 2019 (PowerShell)

How to Setup NTP Server on Windows Server 2019 (PowerShell)
User
5 Min Read
2025/11/24

Configuring an NTP server on Windows Server 2019 with PowerShell is a straightforward job and usually faster than going through the GUI. With a few commands, you can set the server up to provide time for the rest of your network without digging through multiple windows. The steps below cover the settings most admins apply when they want their Windows Server to act as a reliable NTP source.

If you’d rather use the graphical method, we’ve already covered that in a separate guide. And if you want a clean place to test these commands, an Eldernode Windows VPS works well for this setup.

Why NTP Matters

Most Windows environments rely on consistent time to keep logs, authentication, and scheduled tasks in order. If the clock drifts even by a small amount you may see issues with domain logins, certificates, or monitoring tools. That’s why many admins set up their own NTP source on a server they already trust.

Configure NTP Server on Windows Server 2019 with PowerShell

If you prefer doing things quickly, PowerShell is usually the easiest way to set up the NTP service.

Open PowerShell (Run as Administrator) and enable the NTP provider with:

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

Windows won’t treat the server as a time source unless you adjust the AnnounceFlags value. Set it to 5:

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

When the settings are in place, restart the time service so the changes apply:

Restart-Service w32Time

Opening UDP Port 123

NTP won’t respond unless port 123/UDP is open.

If the firewall is enabled on your server, add a simple rule like this:

New-NetFirewallRule
-Name “NTP Server Port”
-DisplayName “NTP Server Port”
-Description “Allow incoming NTP”
-Profile Any
-Direction Inbound
-Action Allow
-Protocol UDP
-Program Any
-LocalAddress Any
-LocalPort 123

Troubleshooting Notes

If a client isn’t syncing, the first thing I usually check is whether port 123/UDP is actually reachable.

You normally don’t need to reboot the server. Just restart the w32Time service and the new settings load right away.

And in domain setups, keep an eye on Group Policy; it can easily override anything you configure locally.

Conclusion

That’s all you need for this setup. Once the time service is restarted and port 123 is open, the server should start responding to NTP queries without touching the GUI. If you hit a strange error or something doesn’t sync the way you expect, drop a note in the comments and we’ll check it out. For more Windows Server how-tos and fixes, the Eldernode Ask page has other practical guides you can browse.

Leave a Reply

Full Name*
Email*
Comment *

Calculate the value of 8 - 3 :

Save my name, email, and website in this browser for the next time I comment.
Recent Replies
Show More

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day