Configuring the time zone and code page with Group Policy - Dennis Span (2024)

Configuring the time zone and code page with Group Policy enables the administrator to centrally manage these settings for a multitude of systems.

Change Log
18.01.2019: added the sectionRedirecting the time zone of the local client in remote sessions.

Table of Contents

    • Configuring the time zone using Group Policy
      • Configuring the time zone using PowerShell
      • Configuring the time zone usingtzutil.exe
      • Redirecting the time zone of the local client in remote sessions
        • Microsoft Remote Desktop Services
        • Citrix Virtual Apps and Desktops (CVAD) / XenDesktop
    • Configuring the code page using Group Policy

Configuring the time zone using Group Policy

Supported operating systems: Windows 2003/XP and higher, up to and including Windows 10 and Windows Server 2016 (all versions and builds).
Supported deployment methods: all, including direct (bare-metal) installations and image-based deployments using technologies such as Citrix Machine Creation Services (MCS) and Citrix Provisioning Services (PVS).

This section deals with the configuration of the time zone settings. On a local machine, these are configured in the Date & Timesettings. Time zone settings are system-specific and not configured per-user (although you can redirect the local time zone in a remote session).

Configuring the time zone and code page with Group Policy - Dennis Span (1)

The time zone configuration is stored in the Windows registry in the HKEY_LOCAL_MACHINE hive. The exact registry key is:

HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

The time zone settings consist of multiple values as seen in the screenshot below.

Configuring the time zone and code page with Group Policy - Dennis Span (2)

To find out the exact value for each of the ten registry entries, first set the time zone manually in the localDate & Time configuration. Afterwards, simply check the aforementioned registry values.

Note: all available time zones are also listed in the registry in the key
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.

Openyour Group Policy Management Console (GPMC.msc) and navigate to ComputerConfiguration \ Preferences \ Windows Settings \ Registry. Since we need to import multiple values, I suggest to use the registry wizard. With a right-mouse click on Registry select New \ Registry Wizard.Now that we have all the information we need, we can set the correct time zone for the local machine. The easiest way to accomplish this is by using a Group Policy Preference registry item. And no, unfortunately there is no native out-of-the-box group policy setting or preference to configure the time zone. This goes for all Windows operating systems.

Configuring the time zone and code page with Group Policy - Dennis Span (3)

On the first page of the wizard, make sure that Local Computer is selected and click Next. On the second tab, the Registry Browser, navigate to the registry key HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation. Tick the box of each individual registry value (as shown in the image below). Use the scroll bar on the right to go down in the list. Unfortunately, there is noSelect All option (@Microsoft: HINT!).

Configuring the time zone and code page with Group Policy - Dennis Span (4)

Click Finish. The registry values have been imported.

If you are unhappy with the organisation of the registry items, you can easily move the individual settings (in the blue box) to a new collection item.

Configuring the time zone and code page with Group Policy - Dennis Span (5)

First, we need to create a new collection item (this is basically a folder). With a right-mouse click on Registry select New \ Collection Item. Enter a name for the collection item, for example TimeZone. Now you can move all individual registry items to this new collection item per drag-and-drop.

Configuring the time zone and code page with Group Policy - Dennis Span (6)

Afterwards, you can delete the collection item namedRegistry Wizard Values (all underlying folders are automatically deleted as well).

The registry item is now created and will be deployed to all machines to which the particular Group Policy applies.

Configuring the time zone and code page with Group Policy - Dennis Span (7)

Note: by default, the value name is used as the name of the registry item (as is visible in the image above). It is possible to rename the registry item afterwards, but please be aware that whenever you make changes to the registry item, it’s name will revert back to the value name.

After configuring the time zone, restart the machine to allow the changes to take effect.

Configuring the time zone using PowerShell

Supported operating systems: Windows 7 / Windows Server 2008 R2 and higher, up to and including Windows 10 and Windows Server 2016 (all versions and builds), with PowerShell 5.1 installed (this is a requirement!).

For those of you who want to include the configuration of the time zone in a PowerShell script, the cmdlet Set-TimeZone can be used. The basic command is as follows:

PowerShell

1

Set-TimeZone -Id "W. Europe Standard Time"

In case the time zone does not exist, an error is returned, which is great when using a try/catch statement. In the example below, I deliberately misspelled the time zone W. Europe Standard Timeto force an error:

PowerShell

1

2

3

4

5

6

7

[string]$TimeZone = "W. Europe Standard Timeeeeeeee"

try {

Set-TimeZone -Id $TimeZone

Write-Host "Success: the time zone $TimeZone has been set"

} Catch {

Write-Host "Error: the time zone $TimeZone does not exist!"

}

The Set-TimeZone cmdlet is included in PowerShell 5.1 and, exceptionally, not restricted to the newest operating systems. This cmdlet also works on Windows 7 and Windows Server 2008 R2. PowerShell 5.1 is included in the Windows Management Framework 5.1.

Note:running the Set-TimeZone PowerShell command as a startup script may end in error 5 “access denied”. At least that is what happened when I tested it on a server running Windows Server 2016 version 1607. I do not know why this happened, especially since the group policy is executed by the local system account.

One drawback of using this method (I can’t believe I am about to say something against using PowerShell) is that the time zone will be hard-coded in the image. In case the time zone needs to be changed, you will have to do one (or more) of the following:

  1. Update the master image.
  2. Update each machine to which the master image was deployed. This only applies to direct (bare-metal) installations. In case you use deployment technologies such as Citrix Machine Creation Services (MCS) or Citrix Provisioning Services (PVS), you will have to update the master image and re-deploy it.
  3. Use a Group Policy to change the time zone. This is the most flexible way to manage time zone settings on a multitude of machines.

Configuring the time zone usingtzutil.exe

Supported operating systems: Windows 2003/XP and higher, up to and including Windows 10 and Windows Server 2016 (all versions and builds).

Besides the PowerShell cmdlet, Microsoft also offers the on-board utilitytzutil.exe to configure the time zone. This tool has been part of the Windows operating system since Windows XP and Server 2003. Here is an example how to set the time zone to Western-Europe Standard Time:

tzutil /s “W. Europe Standard Time”

One drawback of using this method is that the time zone will be hard-coded in the image. Changing the time zone at a later time requires you to do one (or more) of the following:

  1. Update the master image.
  2. Update each machine to which the master image was deployed. This only applies to direct (bare-metal) installations. In case you use deployment technologies such as Citrix Machine Creation Services (MCS) or Citrix Provisioning Services (PVS), you will have to update the master image and re-deploy it.
  3. Use a Group Policy to change the time zone. This is the most flexible way to manage time zone settings on a multitude of machines.

Reference: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh875624(v=ws.11)

Redirecting the time zone of the local client in remote sessions

In case you have users that connect from a different time zone than the server time zone, in remote sessions, you have the option to redirect the local time zone:

  • Microsoft Remote Desktop Services
  • Citrix Virtual Apps and Desktops (CVAD) / XenDesktop

Microsoft Remote Desktop Services

For Remote Desktop Sessions, you can enable a Microsoft group policy that redirects the time zone of the local client. You can find this policy here:

Computer Configuration \ Administrative Templates \ Windows Components \ Remote Desktop Services \ Remote Desktop Session Host \ Device and Resource Redirection -> Allow time zone redirection

Citrix Virtual Apps and Desktops (CVAD) / XenDesktop

For Citrix (ICA) sessions you can configure the policy Use local time of client to redirect the local time zone to the remote server.

Configuring the code page using Group Policy

Supported operating systems: Windows 2003/XP and higher, up to and including Windows 10 and Windows Server 2016 (all versions and builds).
Supported deployment methods: all, including direct (bare-metal) installations and image-based deployments using technologies such as Citrix Machine Creation Services (MCS) and Citrix Provisioning Services (PVS).

This section deals with the configuration of the code page (system locale) of the local system. The code page controls the language the system uses for non-unicode programs. On a local machine, the code page is configured on the third tab, Administrative, of the Regional Settings Control Panel item. The code page issystem-specific (not configured per-user).

Configuring the time zone and code page with Group Policy - Dennis Span (10)

Note: in Windows, the code page is referred to as system locale. I am not in agreement with this, because the system locale also includes other components such as the display language (the Windows language) and the default input language (the keyboard layout) for the system user. These settings determine what a user sees at the Windows logon window (CTRL+ALT+DEL). In therefore in this article use the word code page and not system locale.

The code page setting is stored in the Windows registry in the HKEY_LOCAL_MACHINE hive. The exact registry key and value are:

HKLM\SYSTEM\CurrentControlSet\Control\Nls\Language -> Default (REG_SZ)

Configuring the time zone and code page with Group Policy - Dennis Span (11)

Please be aware that the value Default is not the same as the (Default) value present in every registry key. The code page is stored in the value Default, so this one:

Configuring the time zone and code page with Group Policy - Dennis Span (12)

Not this one:

Configuring the time zone and code page with Group Policy - Dennis Span (13)

To determine the country ID, change the code page manually on your local system. On the local system, open the Regional Settings in the Control Panel. The code page (system locale) can be changed on the third tab. After changing the code page, you will be asked to reboot the system. This is not necessary. The registry value Default containing the code page setting has already been modified. Go to the registry and check your country ID.

For example, when I set the code page toGerman (Austria), the value Defaultis set to 0c07. Before it was 0409, which is the country ID for the United States.

Now that we have all the information we need we can set the correct code page for the local machine. The easiest way to accomplish this is by using a Group Policy Preference registry item.

Openyour Group Policy Management Console (GPMC.msc) and navigate to ComputerConfiguration \ Preferences \ Windows Settings \ Registry. With a right-mouse click on Registry select New \ Registry Item. Configure the registry item as follows:

  • Action: replace
  • Hive: HKEY_LOCAL_MACHINE
  • Key path: SYSTEM\CurrentControlSet\Control\Nls\Language
  • Value name:Default
  • Data type: REG_SZ (= string)
  • Value data: <your value>, e.g. 0c07 or 0409

Configuring the time zone and code page with Group Policy - Dennis Span (14)

The registry item is now created and will be deployed to all machines to which the particular Group Policy applies.

Note: by default, the value name is used as the name of the registry item (as is visible in the image above). It is possible to rename the registry item afterwards, but please be aware that whenever you make changes to the registry item, it’s name will revert back to the value name.

After configuring the code page, restart the machine to allow the changes to take effect.

Configuring the time zone and code page with Group Policy - Dennis Span (15)

Dennis Span

Dennis Span works as a Lead Account Technology Strategist at Cloud Software Group in Vienna, Austria. He holds multiple Citrix certifications (CCE-V). Dennis has been a Citrix Technology Advocate (CTA) since 2017 (+ one year as Citrix Technology Professional, CTP). Besides his interest in virtualization technologies and blogging, he loves spending time with his family as well as snowboarding, playing basketball and rowing. He is fluent in Dutch, English, German and Slovak and speaks some Spanish.

Related

Configuring the time zone and code page with Group Policy - Dennis Span (2024)

FAQs

How to configure time zone via GPO? ›

In the Group Policy window, in the left-hand pane, drill down to Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignments. On the right, find the “Change the system time” item and double-click it.

What is time zone redirection in Group Policy? ›

This policy setting determines whether the client computer redirects its time zone settings to the Remote Desktop Services session. If you enable this policy setting, clients that are capable of time zone redirection send their time zone information to the server.

How to configure regional settings and Windows locales with Group Policy? ›

To set up the Regional settings for multiple users, use the group policy and to the following steps: Launch Group Policy Management, create a new GPO or configure the one you have. See the screenshots. Make all needed settings, and use F6 to confirm the configuration from red to green.

How to set time zone from command line? ›

2. Using Command Prompt
  1. Click on Start.
  2. Look for Command Prompt, right-click and click on Run as administrator option.
  3. Type this to confirm the current time zone and press Enter: tzutil /g.
  4. Type this and note the time zone that you want (IST) and hit Enter: tzutil /l.

How are time zones configured? ›

Each time zone is defined by a standard offset from Coordinated Universal Time (UTC). The offsets range from UTC−12:00 to UTC+14:00, and are usually a whole number of hours, but a few zones are offset by an additional 30 or 45 minutes, such as in India and Nepal.

Which command is used to configure the local time zone? ›

Using the timedatectl command is the most recommended method for changing the current timezone. However, if we don't have the timedatectl command available on our current system, we can create a symlink or change it through the GUI.

How do I stop GPO from changing time zone? ›

Type gpedit.

This will open the Group Policy Editor window. In the right-side pane, double-click on Disallow user override of locale settings. In the pop-up window, check the Enabled radio button. Then click Apply > OK to save the changes.

What are the 4 types of redirecting? ›

Let's look at four types of redirecting. Teachers can redirect verbally, physically, with a cue, or by redirecting the child's attention.

What are the two types of Group Policy configuration policies? ›

Types of Group Policies
  • Local Group Policy: Local Group Policy applies to individual computers and is managed locally on each system. ...
  • Domain Group Policy: Domain Group Policy is the most common type and is used to manage network-wide configurations.

How do I change the locale in group policy? ›

Edit the GPO and go to User Configuration > Administrative Templates > Control Panel > Regional and Language Options. Set Restricts the UI languages Windows should use for the selected user to your desired display language.

How do I get to Computer Configuration in group policy? ›

Open the Local Group Policy Editor (gpedit. msc). In the console tree, click Computer Configuration, select Windows Settings, and then select Security Settings.

How do I get local group policy settings? ›

Resolution
  1. Open an elevated Command Prompt. ( ...
  2. Navigate to the users My Documents folder. ...
  3. Type the command “gpresult /H GPReport. ...
  4. Open the generated html file in a web browser.
  5. You can see both the local and domain applied GPOs. ...
  6. Note the name and location of the applied Group Policy Objects.
Dec 2, 2022

How to set time zone in Windows Server command line? ›

Type tzutil /s “enter correct time zone” and press Enter to set, Type tzutil /g to check if the time zone was updated successfully.

How do I change the time zone on my server? ›

Changing Time Zone in Windows / Windows Server.

- go to the 'Settings' section through the 'Start' menu; - go to the 'Settings' section by right-clicking on the clock icon in the taskbar, where you can select the 'Adjust date and time' option; *By default, the 'Set time automatically' option will be checked.

How do I change the time on my Group Policy update? ›

Expand Computer Configuration, Administrative Templates, System, Group Policy. Double-click "Group Policy refresh interval for computers," then select Enabled. Enter the new refresh rate and the maximum random time to wait for the refresh (to avoid all machines updating at the same time), then click OK.

How do I sync time zone with domain controller? ›

Go to Start -> All Programs -> Accessories, and click Command Prompt. Type in w32tm /resync, and press ENTER (this will synchronize the time to your domain controller).

How to set user timezone in ServiceNow? ›

Set a system time zone
  1. Navigate to All > System Properties > System.
  2. Locate the property System timezone for all users unless overridden in the user's record [glide.sys.default.tz]. ...
  3. Add a time zone in the format Country/City or using the name of a time zone (for example, GMT) and click Save.

How to set time zone in NTP server? ›

To configure a Network Time Protocol (NTP) server:
  1. Go to the Collector CLI.
  2. In the Enter option field, enter 5 (Change Timezone/NTP) and press Enter.
  3. In the Enter option field, enter 2 (Configure NTP) and press Enter.
  4. In the NTP Server field, enter the NTP server hostname and press Enter. ...
  5. Press Enter.

Top Articles
Latest Posts
Article information

Author: Barbera Armstrong

Last Updated:

Views: 6200

Rating: 4.9 / 5 (79 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Barbera Armstrong

Birthday: 1992-09-12

Address: Suite 993 99852 Daugherty Causeway, Ritchiehaven, VT 49630

Phone: +5026838435397

Job: National Engineer

Hobby: Listening to music, Board games, Photography, Ice skating, LARPing, Kite flying, Rugby

Introduction: My name is Barbera Armstrong, I am a lovely, delightful, cooperative, funny, enchanting, vivacious, tender person who loves writing and wants to share my knowledge and understanding with you.