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.

Disclaimer:

The Sample Scripts provided below are adapted from third-party Open-Source sites.

Batch Script

Get the current time zone

Executing this command will display the time zone already set on the device.

Set the time zone

The script sets the time zone on the device to the specified time zone ID.

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

Executing this command will display the time zone already set on the device.

Set the time zone

This script can be used to set the time zone on the device to the specified time zone ID.

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

Notes:

  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository