How to set TimeZone using Powershell
Asked Answered
C

3

17

How can I set TimeZone using Powershell, on a Windows Server 2008 R2 target machine?

Capriccioso answered 20/11, 2010 at 22:2 Comment(0)
T
23

This is how I do it in setup scripts...although our AD infrastructure would set this when the machine joins the domain anyway...I like to be thorough in my scripting :)

%windir%\system32\tzutil /s "Eastern Standard Time"
Twelvetone answered 28/1, 2011 at 18:16 Comment(3)
actually for Powershell remove the %windir%\system32\ as PS wont know how to handle it...you could use C:\Windows\System32\ insteadTwelvetone
system32 is normally in your path so you don't need it at all. tzutil.exe works on any typical out of the box Windows machine (that has the application in system32 :)Inconclusive
The exact powershell equivalent is & "$env:windir\system32\tzutil.exe" /s "Eastern Standard Time" but agreed, you don't actually need system32Shorter
D
11

At least in newer versions of Powershell (5.1 and later), there is a cmdlet. See the docs.

Set-TimeZone "Eastern Standard Time"

Older versions can find the script here.

Ddene answered 28/2, 2017 at 22:1 Comment(0)
C
0

PowerShell command tzutil /g - to see current time zone tzutil /l - list of time zones tzutil /s "example" to change time zone

There are other commands to change the time zone I have explained it in my YouTube video https://youtu.be/JvLa5HjEjHM

Hope this will help you!!

Cloison answered 26/2, 2020 at 13:30 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.