Hey checkyourlogs.net fans!

Here’s a super quick, easy to learn PowerShell technique. As you know, properly setting the time zone in Windows is an import configuration task. Unfortunately, there’s a known issue within some builds of Windows Server 2019 preventing using the GUI to set the time zone. No error, no warning, the change just doesn’t get committed. The solution is simple, use PowerShell.

First things first. Checking the current time zone with PowerShell is as simple as running Get-Timezone.

The cmdlet to set the time zone is Set-TimeZone. Using this cmdlet with the -Id parameter provides a quick and easy method for changing the time zone. For Eastern Standard Time, the cmdlet, with Id parameter, is:

Set-Timezone -Id "Eastern Standard Time"

Remember, in PowerShell, no news is usually good news! If a bunch of red error text doesn’t appear, the command was most likely successful.

What if we don’t know the time zone ID? Easy, find other time zone Ids using the cmdlet:

Get-TimeZone -ListAvailable

The above command lists every possible time zone, which is a big list! The displayed screenshot only displays the first few. Narrow it down by using PowerShell’s pipeline, sending the results of Get-TimeZone -ListAvailable to the Where-Object cmdlet. Where-Object with the -FilterScript parameter filters the results using the part of the time zone name desired. For instance, to find time zones beginning with “Central” use this cmdlet string:

Get-TimeZone -ListAvailable | Where-Object -FilterScript {$_ -match "Central*"}

In this example, the above cmdlet string trims the results to three. Quite a bit more reasonable!

That’s it checkyourlogs.net fans. Quick and easy as promised!