Set correct Date, Time and NTP sync with this Powershell script

I made a Powershell script to automate the process of configuring all Windows regional settings like time, date, locale, culture, country, home location and language keyboard input. This script will also configure NTP and sync your clock.


This is for stand-alone Workgroup computers. In a domain you are best of setting up some GPO’s to solve this. The script is based on this from TechNet that will change some regional settings, but not all. I therefore customized it to do all regional changes and also sync the clock to pool.ntp.org servers. It will also print the results.

Download DateAndTime.ps1 (Configured for Norwegian, Bokmål, nb-NO)

Screenshots/How-to:

The script is configured for Norwegian, Bokmål (nb-NO), and will do the following changes:

Computer settings

  • Set up Date and Time standard / Calendar (ShortDate, LongDate, ShortTime, TimeFormat, FirstDayOfWeek and Country).
  • Set System Locale.
  • Set TimeZone.
  • Set NTP Configuration to all ntp.pool.org servers and force resync **

User settings

  • Set Culture (Regional Format)
  • Set Home Location (GeoID)
  • Set Keyboard Input

** Note: In a domain you should instead sync to a local NTP server such as a DC which is pre-configured to another NTP server. Change line 132:

w32tm /config /syncfromflags:manual /manualpeerlist:"ntp.yourdomain.com"

Hope this will help you.

Leave a Reply

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