Category filter
Script to set time zone on Windows 10 devices
The onset of remote work culture and the need to manage devices across countries and even continents brings up numerous challenges. One such issue is the time zone management of a fleet of devices. Often, to let the employees stay in sync beyond timezone boundaries, setting a standard time zone/date on devices would help. Here’s a script that helps you set up a specific timezone for Windows devices. The Execute Custom Script action lets you execute these customized scripts across devices enrolled in the Hexnode console.
Batch Script
Get the current time zone
Executing this command will display the time zone already set on the device.
1 |
tzutil /g |
Set the time zone
The script sets the time zone on the device to the specified time zone ID.
1 |
tzutil /s “Pacific Standard Time” |
Replace “Pacific Standard Time” with the required time zone.
To obtain list of all time zones, run the following command on the Terminal:
‘tzutil /l
’
‘/l
’ – Lists all valid time zone IDs and display names.
PowerShell Script
Get the current time zone
Get the current time zone
Executing this command will display the time zone already set on the device.
1 |
Get-TimeZone |
Set the time zone
This script can be used to set the time zone on the device to the specified time zone ID.
1 |
Set-TimeZone -Id "UTC" |
Replace “UTC” with the required time zone.
To obtain the complete list of time zone IDs, run the following command on PowerShell:
‘Get-TimeZone -ListAvailable
‘