Wednesday, November 30, 2016

Time display issue in Windows 10 1607 after in-place upgrade

Wow, it has certainly been a long time since the last time I've posted on this blog!  While I keep promising to post more, chances are I'll get busy again and won't have time to post .... which is the perfect segway to todays topic:  TIME!

Lately I've been designing a company-wide migration to Windows 10 1607 using the in-place upgrade option with System Center Configuration Manager Current Branch.  One issue that came up was time ... or rather display time ... being WAY off (and by way off I mean hours, up to 3 hours in some case).

Now you may be thinking "But Terry, doesn't that mean your users can't log in?" ... and the answer is .. well .. no!  See, the issue being experienced only affects the time that is displayed on the system tray and lock screen, not the system time.  System time is critical for domain-joined systems as if you are off by more than 5 minutes, you can't authenticate with AD, so the default behavior is workstations sync time with your local Domain Controller or the PDC Emulator.  System time is done in UTC, and Display Time is UTC +/- your time zone offset.  This means that it is technically possible for time to be correct and incorrect at the same time!

How to tell if you have this problem

  1. Open Windows PowerShell (right-click Run As Administrator, you will find out why later)
  2. Type this command:  w32tm /query /peers
If time is configured correctly then it should be pointing to a local Domain Controller or the PDC Emulator.  Note that if you have specific group policies around workstation time configuration, then you will need to make sure that it matches.  In the case of an affected machine, it will show the following: (i'll post a screenshot shortly)

State: Pending
Time Remaining: (up to 24 hours, in seconds)
Stratum: 0

In my case I have systems spread out over multiple time zones.  In some cases the time displayed properly but it was not syncing from the local DC.  In other cases the display time was out by up to 3 hours!.

How to fix the problem

You still have that PowerShell window open right?  Here are the commands you need to run (in order):

  1. Stop-Service w32time
  2. w32tm /unregister
  3. w32tm /register
  4. Start-Service w32time
  5. w32tm /resync
Once finished you can run w32tm /query /peers again.  If you see something like this, then you are good:

I put these commands into a PowerShell script and put it at the end of my in-place upgrade Task Sequence in Configuration Manager:

And there you have it!  What do you think?