Powershell: Automatically Check and Correct multiple NTP Clients

Here is the script that will help system admins to automatically check the windows NTP settings on multiple computers through registry. For this to work, you need to enable Remote Powershell on client computers. If remote powershell is not enabled on each of the servers to be checked, you can find my post here to enable it.

What this script will do:
This scipt will,

1) check the necessary ports (5985 or 5986), if winRM is enabled for Remote Powershell.
2) Check the current NTP values.in registry with the pre-defined values in script. If not matched, you can correct instantly.
3) Select the standard TimeZone of servers by the occurrence of mostly used values.
4) If the appropriate time zone not found, your machine time zone will be used as standard time zone. And compare each server with the standard timezone. If not matched, you can prompted to correct.
5) It select the standard time by the occurrence of current time values on each server.(compare up to minutes’ detail)
6) If the appropriate current time is not found, your machine time will be used as standard time. And compare each server with the standard time. If not matched, you are prompted to correct.
7) It will detect the stopped time service and prompted you to start the service.

Glad if you find it useful, Cheers !

Change Windows NTP with Powershell
Fig-1: The demo Run

You can download my script from github.

2 thoughts on “Powershell: Automatically Check and Correct multiple NTP Clients”

  1. Hello good Morning
    I find it very interesting and a very good script, since there is nothing similar on the net, I would like to try the script, however I do not see it available for download, it would be possible if you could share this script with me

Leave a Reply

Your email address will not be published. Required fields are marked *