Ask Your Question

Revision history [back]

Here are the steps to configure a Windows machine to function as an NTP server using PowerShell:

  1. Open PowerShell with administrative privileges.

  2. Run the following command to check if the Windows Time service is running:

    Get-Service -Name W32Time

  3. If the Windows Time service is not running, start it by running the following command:

    Start-Service -Name W32Time

  4. Set the Windows Time service to start automatically by running the following command:

    Set-Service -Name W32Time -StartupType Automatic

  5. 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

  6. 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

  7. Enable the NTP server feature by running the following command:

    w32tm /config /reliable:yes /update

  8. 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.