1 | initial version |
Here are the steps to configure a Windows machine to function as an NTP server using PowerShell:
Open PowerShell with administrative privileges.
Run the following command to check if the Windows Time service is running:
Get-Service -Name W32Time
If the Windows Time service is not running, start it by running the following command:
Start-Service -Name W32Time
Set the Windows Time service to start automatically by running the following command:
Set-Service -Name W32Time -StartupType Automatic
Open the UDP port 123 on the Windows firewall by running the following command:
New-NetFirewallRule -DisplayName "NTP" -Direction Inbound -LocalPort 123 -Protocol UDP -Action Allow
Configure the Windows machine to use itself as the NTP server by running the following command:
w32tm /config /manualpeerlist:"127.0.0.1" /syncfromflags:MANUAL /update
Enable the NTP server feature by running the following command:
w32tm /config /reliable:yes /update
Restart the Windows Time service by running the following command:
Restart-Service -Name W32Time
Your Windows machine is now configured as an NTP server. Other devices on your network can now synchronize their time with it.