Windows server 2019 change timezone

Network Time Protocol (NTP) is a highly scalable internet protocol that determines the best time information and synchronizes accurate settings on a computer system. This guide explains how to set the time zone and configure NTP on a Windows Server.

This guide uses Windows Server 2019, but these instructions work on any machine with Server 2016 or later.

Prerequisites

Before you begin:

  • Deploy a Vultr Windows Server.
  • Connect to the server.

Set the Timezone

  1. Using the Windows Start Menu, open Server Manager.
  2. Locate Time zone in the local server properties section.
  3. Click the current timezone, which is UTC Coordinated Universal Timeby default.
  4. In the Date and Time window, click Change time zone.
  5. Expand the Time zone drop-down list.
  6. Select your preferred timezone. It’s recommended to set it to your server location.
  7. Click OK to save changes.
  8. Click Apply to load changes on the server.
  9. Re-open Server Manager, and verify the timezone change.

Optional: Set the Timezone using PowerShell

  1. From the start menu, open Windows PowerShell, or open the run dialog (Win key + R), type powershell in the search bar, and click OK to start PowerShell.

  2. Run the following command to check the server timezone.

     PS > Get-Timezone
  3. View all available timezones.

     PS> Get-Timezone -ListAvailable

    To find your target timezone, use the following command to filter by name.

     PS> Get-Timezone -ListAvailable | Where-Object {$_.displayname -like "*US*"}

    > The command above displays all names containing the characters US. You can use a different string such as London.

  4. Change your timezone.

     PS> Set-Timezone -Name "Central Standard Time"

    You can also change the timezone by ID.

     PS> Set-Timezone -Id "Central Standard Time"

Configure NTP

In addition to setting the timezone, you can also configure Windows to use NTP to synchronize the time.

  1. Open the Run dialog window by pressing the Windows key (WIN) + R on your keyboard.

  2. In the search bar, enter regedit and click OK to open Registry Editor.

  3. Expand the registry navigation tree:

    HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services

  4. Expand W32Time.

  5. Click Config.

  6. Select AnnounceFlags

  7. Enter 5 in the Value data field.

  8. Click OK to save changes.

  9. In the left pane, click Parameters.

Optional: Change the NTP Server

By default, Vultr uses the time.constant.com time server, located on our high-speed infrastructure. If you want to use a different time server, you can change the value of the NtpServer parameter by following these steps.

  1. Double-click NtpServer

  2. Change the value data field to your preferred value. For example, to sync with the United States NTP pool, use:

     us.pool.ntp.org

    You can find a list of NTP Pool servers at the official website.

  3. Expand TimeProviders.

  4. Click NtpServer.

  5. Double click Enabled, change the value data from 0 to 1, and click OK to save changes.

  6. Close the registry editor, open the start menu, and search the keyword services.

  7. In the services window, scroll through the list, select Windows Time, right-click, and select Restart to apply NTP changes.

    Restart the Windows Time Service

Optional: Configure NTP Using PowerShell

If you prefer to use Powershell, you can use the following commands to configure NTP.

  1. Open PowerShell with administrative privileges.

  2. Check the NTP time synchronization status.

     PS> w32tm /query /status
  3. Enter the following command to set the time AnnounceFlags to 5.

     PS> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Config" -Name "AnnounceFlags" -Value 5 
  4. (Optional) If you want to use NTP pool servers instead of Vultr’s NTP server, run the following command.

     PS> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\Parameters" -Name "NtpServer" -Value us.pool.ntp.org
  5. Enable NTP Server.

     PS> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer" -Name "Enabled" -Value 1
  6. Restart the Windows Time service.

     PS> Restart-Service w32Time
  7. Test NTP synchronization.

     PS> w32tm /resync

Next Steps

You have successfully set the timezone and configured NTP on Windows Server 2019. If you plan to have other machines on a Vultr VPC use your NTP server, allow port 123 in the Windows Server Firewall. For further information, refer to the following guides.

  • Official NTP Documentation
  • List of database TimeZones
  • Configure the Firewall on Windows Server 2019
  • Create A Vultr Virtual Private Cloud (VPC)

In this article, we want to teach you How To Change the Time Zone on Windows Server 2019.

The term Time Zone can be used to describe several different things, but mostly it refers to the local time of a region or a country.

As you know, changing the Time Zone is important for people who use a variety of Windows services and provide that service on a network or Internet level.

In this guide, you will learn to change Time Zone with PowerShell.

Steps To Change Time Zone on Windows Server 2019 with PowerShell

To change the Time Zone with PowerShell, you need to open a PowerShell with Administrator access.

To do this, from your start menu type PowerShell and right-click on it, and select Run as an Administrator.

Check the Current Time Zone on Windows Server 2019

After you open your PowerShell on your Windows Server, run the following command to see your current Time Zone:

Get-TimeZone

In your output, you will see something similar to this:

Output
Id                         : Pacific Standard Time
DisplayName                : (UTC-08:00) Pacific Time (US & Canada)
StandardName               : Pacific Standard Time
DaylightName               : Pacific Daylight Time
BaseUtcOffset              : -08:00:00
SupportsDaylightSavingTime : True

List Available Time Zones on Windows Server 2019

Now you can use the following command to list the available Time Zones on your Windows Server:

Get-TimeZone -ListAvailable

In your output you will see:

Output
Id                         : Dateline Standard Time
DisplayName                : (UTC-12:00) International Date Line West
StandardName               : Dateline Standard Time
DaylightName               : Dateline Daylight Time
BaseUtcOffset              : -12:00:00
SupportsDaylightSavingTime : False

Id                         : UTC-11
DisplayName                : (UTC-11:00) Coordinated Universal Time-11
StandardName               : UTC-11
DaylightName               : UTC-11
BaseUtcOffset              : -11:00:00
SupportsDaylightSavingTime : False

Id                         : Aleutian Standard Time
DisplayName                : (UTC-10:00) Aleutian Islands
StandardName               : Aleutian Standard Time
DaylightName               : Aleutian Daylight Time
BaseUtcOffset              : -10:00:00
SupportsDaylightSavingTime : True
...

After viewing the list of available time zones and selecting the desired time zone, with the Set-TimeZone command you can set your Windows server time zone.

Set Time Zone

For example:

Set-TimeZone -Name “Canada Central Standard Time”

At this point, you can use the following command again to see your current Time Zone:

Get-TimeZone

In your output you will see that your Time Zone has been changed:

Output
Id                         : Canada Central Standard Time
DisplayName                : (UTC-06:00) Saskatchewan
StandardName               : Canada Central Standard Time
DaylightName               : Canada Central Daylight Time
BaseUtcOffset              : -06:00:00
SupportsDaylightSavingTime : False

Also, you can use different ways to change your Windows Time Zone like:

Change the Time Zone from the CMD, from the control panel, and from the setting.

Conclusion

At this point, you have successfully changed your Windows Server 2019 Time Zone.

Hope you enjoy it.

Maybe you will be interested in these articles:

Install and Configure Apache on Windows Server 2019.

How To Run Nginx on Windows Server 2019.

Чтобы на вашем устройстве Windows показывалось правильное время, часовой пояс (time zone) на нем должен соответствовать географическому расположению компьютера. В этой статье мы рассмотрим, как задать часовой пояс в Windows из панели управления, из командной стоки, PowerShell и через групповые политики.

Содержание:

  • Настройка часового пояса через панель управления Windows
  • Изменить часовой пояс из командной строки с помощью TZutil
  • Управление часовым поясом в Windows из PowerShell
  • Настройка часового пояса Windows через GPO

Настройка часового пояса через панель управления Windows

Начиная с Windows 10 и Windows Server 2016 для настройки времени часового пояса в Windows используется отдельный раздел в панели Параметры/Settings. Выполните команду
ms-settings:dateandtime
или щелкните по значку часов в системном трее и выберите пункт Adjust date/time (Настройка времени и даты).

По умолчанию Windows пытается автоматически синхронизировать время и выбрать часовой пояс (включена опция Set time zone automatically/Автоматически устанавливать часовой пояс).

Чтобы выбрать часовой пояс вручную, нужно отключить эту опцию и выбрать пояс в выпадающем списке.

параметры часового пояса windows 10 в приложении параметрыchasovogo-poyasa

Также для управления часовым поясом можно использовать классическое окно настройки времени в Windows (команда
timedate.cpl
).

windows10 выбор часового пояса

При попытке изменить часовой пояс в Windows Server 2019 и 2022 под администратором из панели управления появляется ошибка:

Date and time
Unable to continue. You do not have permission to perform this task. Please contact your computer administrator for help.
Продолжение невозможно. У вас нет разрешения на выполнение этой задачи. Обратитесь за помощью к сетевому администратору.

Чтобы решить эту проблему, проверьте что у вашей учетной записи есть права на смену часового пояса. Откройте редактор локальной групповой политики (
gpedit.msc
), перейти в раздел Computer Configuration -> Windows Settings -> Security Settings -> Local Policiers -> User Rights Assignment и добавить встроенную группу Administrators в параметр Change the time zone.

изменить часовой пояс ограничение в локальной политике

После обновления настроек GPO запустите командную строку с правами администратора (!!!), выполните команду
timedate.cpl
и вы сможете изменить часовой пояс. Либо в качестве обходного решения вы можете изменить часовой пояс из командной строки.

Изменить часовой пояс из командной строки с помощью TZutil

Для управления часовым поясом в Windows можно использовать встроенную утилиту
tzutil.exe
(Windows Time Zone Utility).

Вывести идентификатор текущего часового пояса (TimeZoneID):

tzutil /g

Russian Standard Time

Выведите список всех часовых поясов с их параметрами и названиями:

tzutil /l

Если вам нужно быстро найти вывести все часовые пояса, с определенным с сдвигом, например UTC +2, выполните команду:

tzutil /l | find /I "utc+02"

поиск временных зон по UTC смещению

Чтобы изменить текущий часовой часовой пояс (UTC+03:00) Москва, Санкт-Петербург, Волгоград – (Russian Standard Time) на (UTC+04:00) Ижевск, Самара (Russia Time Zone 3), выполните команду:
tzutil /s "Russia Time Zone 3"

Текущий часовой пояс хранится в следующей ветке реестра:

reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

настройки часового пояса в реестре

Если в часовом поясе предусмотрен переход на летнее время, его можно отключить. Для этого нужно указать идентификатор часового пояса с суффиксом _dstoff:

tzutil /s "Pacific Standard Time_dstoff"

Эта команда изменит часовой пояс компьютера и отключите сезонный перевод часов.

Настройки часового пояса и сезонного перевод часов можно вывести так:

w32tm /tz

Часовой пояс: Текущий:TIME_ZONE_ID_UNKNOWN Сдвиг: -180мин (UTC=LocalTime+Bias)
[Зимнее время:"RTZ 2 (зима)" Сдвиг:0мин Дата:(не указано)]
[Летнее время:"RTZ 2 (лето)" Сдвиг:-60мин Дата:(не указано)]

w32tm /tz

Управление часовым поясом в Windows из PowerShell

Чтобы узнать текущий часовой пояс Windows из PowerShell, выполните команду:

Get-TimeZone

Id                         : Ekaterinburg Standard Time
DisplayName                : (UTC+05:00) Екатеринбург
StandardName               : RTZ 4 (зима)
DaylightName               : RTZ 4 (лето)
BaseUtcOffset              : 05:00:00
SupportsDaylightSavingTime : True

powershell Get-TimeZone

Вывести доступные часовые пояса:

Get-TimeZone -ListAvailable

Get-TimeZone -ListAvailable

Для поиска в списке часовых поясов воспользуйтесь фильтром:

Get-TimeZone -ListAvailable | Where-Object {$_.displayname -like "*Samara*"}

фильтр для часовых поясов в powershell

Изменить часовой пояс:

Set-TimeZone -Name "Astrakhan Standard Time"

Или

Get-TimeZone -ListAvailable|? DisplayName -like "*Moscow*"|Set-TimeZone

Удаленно получить список часовых поясов на серверах Windows (список в txt файле):

$servers = get-content C:\servers.txt
Get-WMIObject -Class Win32_TimeZone -Computer $servers | select-Object PSComputerName, Caption

Изменить часовой пояс на списке серверов Windows:

$servers = get-content C:\servers.txt
Invoke-Command -ComputerName $servers -Command {Set-TimeZone "West Asia Standard Time"}

В этих примерах используется версия PowerShell 5.1, но они также работают и в более новых версиях.

Настройка часового пояса Windows через GPO

Для централизованной настройки часового пояса на компьютерах в домене Active Directory вы можете использовать групповые политики. Готовой политики для настройки часового пояса в GPO нет. Чаще всего используются следующие два варианта настройки часового пояса через GPO: с помощью logon скрипта GPO и с помощью импорта настроек часового пояса в реестр.

Для задания часового пояса через логон скрипт GPO, можете использовать простейший PowerShell скрипт (подходит для всех версий Windows):

$tmZone = "Russian Standard Time"
$WinOSVerReg = Get-Item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
$WinOSVer = $WinOSVerReg.GetValue("CurrentVersion")
if ($WinOSVer -GE 6){
tzutil.exe /s $tmZone
} Else {
$param = "/c Start `"Change tmZone`" /MIN %WINDIR%\System32\Control.exe TIMEDATE.CPL,,/Z "
$param += $tmZone
$proc = [System.Diagnostics.Process]::Start( "CMD.exe", $param )
}

Другой способ настроек времени заключается в импорте содержимого ветки HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation с эталонного компьютера с настроенным временем на другие компьютеры через GPO. Процедура импорта ветки реестра через Group Policy Preferences описана в этой статье.

Выберите эту ветку целиком с помощью Registry Browser. В результате все настройки временной зоны будут импортированы в раздел редактора GPO (Computer Configuration -> Preferences -> Windows Settings -> Registry).

задать часовой пояс на компьютерах в домене ad через gpo

Если вы хотите использовать разные настройки временных зон для разных сайтов Acrive Directory, воспользуйтесь GPP Item Level Targeting. Привяжите настройки часового пояса к нужному сайту.

групповая политика для настройки часового пояса в зависимости от сайта active directoryad

Если вы используете терминальные фермы RDS серверов, и пользователи и сервера RDSH находятся в разных часовых поясах, то в RDP сессий у пользователя будет отображаться некорректное время. Чтобы перенаправить локальный часовой пояс пользователя в RDP сессию, включите параметр GPO Allow time zone redirection (Computer Configuration > Policies -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Device and Resource Redirection.

Отметим, что часовой пояс, как и дата/время, является одним из значимых параметров компьютера, влияющих на правильное функционирование Windows и различных приложений. Рекомендуется устанавливать часовой пояс в соответствии с географическим положением компьютера.

Предоставление прав на изменение часового пояса в Windows.

Чтобы ограничить права пользователей на изменение часового пояса, необходимо открыть локальную политику безопасности через командную строку с помощью команды: secpol.msc В открывшемся окне перейдите по пути: Security Settings -> Local Policy -> User Rights Assignment -> Change the time zone (Изменение часового пояса).

Чтобы ограничить права пользователей на изменение часового пояса, необходимо удалить ‘Users’ из списка учетных записей пользователей. В Windows Server изменять часовой пояс могут пользователи из групп ‘Local Service’ и ‘Administrators’.

Настройка часового пояса в Windows

Изменение часового пояса в Windows / Windows Server.

Изменение часового пояса в графическом интерфейсе Windows

В операционных системах Windows 10 и Windows Server 2019/2016 для настройки времени и часового пояса можно:

— перейти в раздел «Настройки» через меню «Пуск»;
— перейти в раздел «Параметры», щелкнув правой кнопкой мыши по значку часов на панели задач, где можно выбрать опцию «Настроить дату и время»;


Настройка часового пояса в Windows

*Поумолчанию опция «Устанавливать время автоматически» будет отмечена. Вы можете отключить эту опцию и вручную выбрать нужный часовой пояс из выпадающего списка.

— Запустите timedate.cpl из cmd, и он откроет окно настроек времени Windows, где вы можете указать часовой пояс с помощью кнопки «Изменить часовой пояс».

Настройка часового пояса в Windows

Изменение часового пояса из cmd с помощью утилиты TZUtil

Откройте командную строку cmd.exe
* Отметим, что утилита tzutil.exe подходит для Windows 10/11, Windows Server 2016/2019/2022
Сначала определите текущий часовой пояс и его идентификатор (TimeZoneID). Для этого введите команду:

tzutil /g

Если вы не уверены в точном названии нужного часового пояса, выведите список всех часовых поясов с их названиями и идентификаторами с помощью следующей команды:

tzutil /l

Вы также можете найти актуальный список часовых поясов Windows у Microsoft.

Чтобы изменить текущий часовой пояс, укажите идентификатор нового часового пояса в следующем формате:

tzutil /s "GTB Standard Time"


В реестре Windows можно проверить текущий часовой пояс:

reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
Настройка часового пояса в Windows

Чтобы отключить переход на летнее время для определенной зоны, необходимо указать идентификатор часового пояса с окончанием: _dstoff

tzutil /s "GTB Standard Time_dstoff"

Чтобы отобразить полную информацию о часовом поясе и настройках сезонных часов, введите следующую команду :

 w32tm /tz
Настройка часового пояса в Windows

Изменение часового пояса с помощью PowerShell

Чтобы определить текущий часовой пояс в консоли PowerShell, используйте одну из следующих команд:

 [TimeZoneInfo]::Local
Get-TimeZone
Настройка часового пояса в Windows

Чтобы просмотреть список всех доступных часовых поясов в консоли PowerShell, вы также можете использовать одну из следующих команд:

Get-TimeZone -ListAvailable
[System.TimeZoneInfo]::GetSystemTimeZones()

Список всех часовых поясов достаточно велик, поэтому для удобства рекомендуется использовать фильтр, в котором указывается часть названия, например:

Get-TimeZone -ListAvailable | Where-Object {$_.Id -like "*FLE*"}
Настройка часового пояса в Windows

Чтобы изменить текущий часовой пояс из консоли PowerShell, введите команду:

 Set-TimeZone -Name "FLE Standard Time"

*укажите название нужного часового пояса в кавычках.

Introduction

Time in a network and Windows environment is mission-critical. Setting the correct time zone is essential. Normally this is a quick change under “Settings” in Windows Server 2019. But that is not a walk in the park, so we’ll show to use PowerShell to set the time zone. I’m blogging this as I have given this tip so many times I should really write it down in a post. Even worse, I have seen people make unnecessary changes to their security policies in attempts to make the GUI work.

Setting the Time Zone In Windows Server 2019

Normally to change the time zone in Windows Server 2019 Desktop Experience you do this via Data & time under settings.

Use PowerShell to set the time zone

Change the time zone

But while that seems to work, it doesn’t persist the settings. Oh, well. we try via the “classic” GUI way and try it there. Unfortunately, that doesn’t work but throws an error:

Unable to continue. You do not have permission to perform this task. Please contact your computer administrator for help.

Use PowerShell to set the time zone

Wait a minute I have admin rights, so I should be allowed to do this.

That the local user rights seem OK.

Use PowerShell to set the time zone

Now the silly thing is that this has been broken in the Windows Server 2019 Desktop Experience from day one and it still has not been fixed. Highly annoying but easy enough to workaround. Well, what’s left? The CLI? No, we use PowerShell to set the time zone

Via Get-TimeZone –ListAvailable you can see all the time zone you can set. To find yours easily just filter on the display name. The output will tell you the ID you need to pass into the Set-TimeZone command. I use ‘Brussels’ in the filter as I know that city is in the time zone I need.

Get-TimeZone –ListAvailable | Where-Object {$_.displayname -match 'Brussels'}

So the ID I need is “Romance Standard Time” for GMT+1 in Brussels.
Set-TimeZone -Id 'Romance Standard Time'

And that is it, you will see the correct time zone under Settings, Date & Time immediately.

PowerShell does the job

All this without having to adjust any permissions, which makes sense as they are correct. It’s Windows Server 2019 that has a GUI bug. So now I cam finally send everyone to this blog post.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как называется исполняемый файл модуля upos располагающийся на ккм с системой windows
  • Скопировать все имеющиеся в каталоге windows исполняемые файлы в каталог winex
  • Mach 3 для windows 7
  • Смена релиза windows 10
  • Что такое изоляция ядра windows 11