In this short article, we are going to teach you about the NTP Server configuration via PowerShell. In previous articles, we taught you Tutorial Configure NTP Server in Windows Server 2019 which you can refer to that article.
You can Choose your perfect Windows VPS Server Packages from eldernode.
Configure NTP Server on Windows 2019 using PowerShell
Performing NTP settings via PowerShell is easier and shorter and does not involve complicated steps. To do this, first open PowerShell with the admin access (Run As Administrator) and run the following command to activate NtpServer.
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer" -Name "Enabled" -Value 1
Now use the following command to set the Value data of the AnnounceFlags file to 5.
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Config" -Name "AnnounceFlags" -Value 5
Finally, after making the above settings, we will restart NtpServer using the following command.
Note: If your Windows Server Firewall is enabled, you must open the UDP 123 port on the Firewall.
New-NetFirewallRule ` -Name "NTP Server Port" ` -DisplayName "NTP Server Port" ` -Description 'Allow NTP Server Port' ` -Profile Any ` -Direction Inbound ` -Action Allow ` -Protocol UDP ` -Program Any ` -LocalAddress Any ` -LocalPort 123
Dear user, we hope you would enjoy this tutorial, you can ask questions about this training in the comments section, or to solve other problems in the field of Eldernode training, refer to the Ask page section and raise your problem in it as soon as possible. Make time for other users and experts to answer your questions.
Tutorial NTP Server Configuration in Windows 2019 via Powershell.