Set-TimeZone function (PowerShell)

Set the system time zone with a simple function.

Set-TimeZone.ps1
 
 
 
 
 
3.9 Star
(7)
4,058 times
Add to favorites
Operating System
9/1/2011
E-mail Twitter del.icio.us Digg Facebook
  • ValidateSet
    1 Posts | Last post February 17, 2014
    • Hey Ben,
      
      Great script!  You could make it a little easier to use by adding validateset to restrict, and add tab completion, the timezon parameter.  I did it for my computer using the valid timezone list off of msdn:
      
      http://technet.microsoft.com/en-us/library/cc749073(v=WS.10).aspx
      
      I'd post the whole list here but it passes the allowed character list.  you can view the data at pastebin: http://pastebin.com/W68c6Dgi
  • Thanks
    1 Posts | Last post October 09, 2012
    • This was a really helpful script. I've used it a few times for time zone settings in my environment.
  • Remote Execution
    1 Posts | Last post May 16, 2012
    • Is there a way to use this function to change the time zone on a group of remote servers?
  • MDT / User permissions
    2 Posts | Last post September 13, 2011
    • My company has a large remote event and I could use this script to update the timezones for everyone that attends the event.  Last year, we had to hack at the registry permissions via GPO so that users could change the timezones themselves, since they don't have admin rights.  This will make it easier since we could attach it with GPP and use item-level targeting to target the subnets at the event and then reverse the process when the event is over.
      
      On a side note, doesn't MDT have a built-in way to set the timezone?
      
    • Blog post on MDT and timezones: http://www.frickelsoft.net/blog/?p=264