How can I set TimeZone using Powershell, on a Windows Server 2008 R2 target machine?
How to set TimeZone using Powershell
Asked Answered
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"
actually for Powershell remove the %windir%\system32\ as PS wont know how to handle it...you could use C:\Windows\System32\ instead –
Twelvetone
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 system32 –
Shorter 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!!
© 2022 - 2025 — McMap. All rights reserved.