Use PowerShell to set the time zone


Time in a network and Windows environment is mission-critical. Setting the correct time zone is essential. Normally this is a quick change under “Settings” in Windows Server 2019. But that is not a walk in the park, so we’ll show to use PowerShell to set the time zone. I’m blogging this as I have given this tip so many times I should really write it down in a post. Even worse, I have seen people make unnecessary changes to their security policies in attempts to make the GUI work.

Setting the Time Zone In Windows Server 2019

Normally to change the time zone in Windows Server 2019 Desktop Experience you do this via Data & time under settings.

Use PowerShell to set the time zone
Change the time zone

But while that seems to work, it doesn’t persist the settings. Oh, well. we try via the “classic” GUI way and try it there. Unfortunately, that doesn’t work but throws an error:

Unable to continue. You do not have permission to perform this task. Please contact your computer administrator for help.

Use PowerShell to set the time zone

Wait a minute I have admin rights, so I should be allowed to do this.

That the local user rights seem OK.

Use PowerShell to set the time zone

Now the silly thing is that this has been broken in the Windows Server 2019 Desktop Experience from day one and it still has not been fixed. Highly annoying but easy enough to workaround. Well, what’s left? The CLI? No, we use PowerShell to set the time zone

Via Get-TimeZone –ListAvailable you can see all the time zone you can set. To find yours easily just filter on the display name. The output will tell you the ID you need to pass into the Set-TimeZone command. I use ‘Brussels’ in the filter as I know that city is in the time zone I need.

Get-TimeZone –ListAvailable | Where-Object {$_.displayname -match 'Brussels'}
So the ID I need is “Romance Standard Time” for GMT+1 in Brussels.
Set-TimeZone -Id 'Romance Standard Time'

And that is it, you will see the correct time zone under Settings, Date & Time immediately.

PowerShell does the job

All this without having to adjust any permissions, which makes sense as they are correct. It’s Windows Server 2019 that has a GUI bug. So now I cam finally send everyone to this blog post.

3 thoughts on “Use PowerShell to set the time zone

  1. No need for the extra step

    Get-TimeZone -ListAvailable | Where-Object {$_.displayname -match ‘Brussels’} | Set-TimeZone

  2. AFAIK, local user “Administrator” can change the timezone via GUI. But other user with admin rights cannot.

Leave a Reply, get the discussion going, share and learn with your peers.

This site uses Akismet to reduce spam. Learn how your comment data is processed.