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
- Using the Windows Start Menu, open Server Manager.
- Locate Time zone in the local server properties section.
- Click the current timezone, which is UTC Coordinated Universal Timeby default.
- In the Date and Time window, click Change time zone.
- Expand the Time zone drop-down list.
- Select your preferred timezone. It’s recommended to set it to your server location.
- Click OK to save changes.
- Click Apply to load changes on the server.
- Re-open Server Manager, and verify the timezone change.
Optional: Set the Timezone using PowerShell
-
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. -
Run the following command to check the server timezone.
PS > Get-Timezone
-
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. -
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.
-
Open the Run dialog window by pressing the Windows key (WIN) + R on your keyboard.
-
In the search bar, enter
regedit
and click OK to open Registry Editor. -
Expand the registry navigation tree:
HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services
-
Expand W32Time.
-
Click Config.
-
Select AnnounceFlags
-
Enter
5
in the Value data field. -
Click OK to save changes.
-
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.
-
Double-click NtpServer
-
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.
-
Expand TimeProviders.
-
Click NtpServer.
-
Double click Enabled, change the value data from
0
to1
, and click OK to save changes. -
Close the registry editor, open the start menu, and search the keyword
services
. -
In the services window, scroll through the list, select Windows Time, right-click, and select Restart to apply NTP changes.
Optional: Configure NTP Using PowerShell
If you prefer to use Powershell, you can use the following commands to configure NTP.
-
Open PowerShell with administrative privileges.
-
Check the NTP time synchronization status.
PS> w32tm /query /status
-
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
-
(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
-
Enable NTP Server.
PS> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer" -Name "Enabled" -Value 1
-
Restart the Windows Time service.
PS> Restart-Service w32Time
-
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)
1. Change Date and Time Windows Server 2022 2019, 2016 from CMD
2. Change Date and Time Windows Server 2022 2019, 2016 from PowerShell
Windows Server plays an essential role in organizations of all kinds thanks to each of its functions, roles and characteristics that allow comprehensive, global and functional administration of each object of the organization, we are talking about users, computers, printers, shared resources and plus..
When Windows Server 2016, 2019 or 2022 is installed, the time and date are assigned based on the user’s location, this is something natural in this process but there may come a time when it is necessary to change the date and time for some task administrative or because the server changes its geographical location, be careful not to do this operation in an environment where the users are still working, since we can cause access problems to the shared resources.
There is the possibility of changing the date and time from CMD or PowerShell and we will see how to achieve it in Windows Server, in this case version 2022 but it applies equally to other versions..
To stay up to date, remember to subscribe to our YouTube channel!
SUBSCRIBE ON YOUTUBE
1. Change Date and Time Windows Server 2022 2019, 2016 from CMD
Step 1
First of all we open CMD, this will open as administrator by default in Windows Server:
Step 2
We will use the following syntax to change the time on the server:
time HH/SEC/MIN AM/PM
Step 3
In this case we have established a PM time, we validate that the change has been applied:
Step 4
It is possible to use the 24-hour format without the AM/PM, we just have to enter the time in that format in the console:
step 5
We validate the change:
step 6
To change the date in Windows Server from CMD, we are going to use the following syntax:
date MM-DD-YY
step 7
Validate the change in the taskbar:
2. Change Date and Time Windows Server 2022 2019, 2016 from PowerShell
Step 1
Now it is time to use the PowerShell console, for this we open PowerShell, it will open with administrative privileges by default:
Step 2
We list the current date with the command:
get-date
Step 3
Modify the date and time with the following command on a single line:
set-date -date “day, # day of month of year HH:MM:SS”
Step 4
Now we validate the date and time change:
step 5
In the console we can list the current time zone:
get-wmiobject win32_timezone
In case it must be modified, it will be necessary to use the tzutil command for it.
This is the way we can change the date and time in Windows Server from CMD or PowerShell.
Отметим, что часовой пояс, как и дата/время, является одним из значимых параметров компьютера, влияющих на правильное функционирование Windows и различных приложений. Рекомендуется устанавливать часовой пояс в соответствии с географическим положением компьютера.
Предоставление прав на изменение часового пояса в Windows.
Чтобы ограничить права пользователей на изменение часового пояса, необходимо открыть локальную политику безопасности через командную строку с помощью команды: secpol.msc В открывшемся окне перейдите по пути: Security Settings -> Local Policy -> User Rights Assignment -> Change the time zone (Изменение часового пояса).
Чтобы ограничить права пользователей на изменение часового пояса, необходимо удалить ‘Users’ из списка учетных записей пользователей. В Windows Server изменять часовой пояс могут пользователи из групп ‘Local Service’ и ‘Administrators’.
Изменение часового пояса в Windows / Windows Server.
Изменение часового пояса в графическом интерфейсе Windows
В операционных системах Windows 10 и Windows Server 2019/2016 для настройки времени и часового пояса можно:
— перейти в раздел «Настройки» через меню «Пуск»;
— перейти в раздел «Параметры», щелкнув правой кнопкой мыши по значку часов на панели задач, где можно выбрать опцию «Настроить дату и время»;
*Поумолчанию опция «Устанавливать время автоматически» будет отмечена. Вы можете отключить эту опцию и вручную выбрать нужный часовой пояс из выпадающего списка.
— Запустите timedate.cpl из cmd, и он откроет окно настроек времени 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
Чтобы отключить переход на летнее время для определенной зоны, необходимо указать идентификатор часового пояса с окончанием: _dstoff
tzutil /s "GTB Standard Time_dstoff"
Чтобы отобразить полную информацию о часовом поясе и настройках сезонных часов, введите следующую команду :
w32tm /tz
Изменение часового пояса с помощью PowerShell
Чтобы определить текущий часовой пояс в консоли PowerShell, используйте одну из следующих команд:
[TimeZoneInfo]::Local
Get-TimeZone
Чтобы просмотреть список всех доступных часовых поясов в консоли PowerShell, вы также можете использовать одну из следующих команд:
Get-TimeZone -ListAvailable
[System.TimeZoneInfo]::GetSystemTimeZones()
Список всех часовых поясов достаточно велик, поэтому для удобства рекомендуется использовать фильтр, в котором указывается часть названия, например:
Get-TimeZone -ListAvailable | Where-Object {$_.Id -like "*FLE*"}
Чтобы изменить текущий часовой пояс из консоли PowerShell, введите команду:
Set-TimeZone -Name "FLE Standard Time"
*укажите название нужного часового пояса в кавычках.
В Windows Server 2019 и 2022 по умолчанию указан сервер времени time.windows.com. В некоторых средах он недоступен, но точное время нужно, но заменить сервер времени по умолчанию через пользовательский интерфейс затруднительно. Заменить сервер времени можно отредактировав реестр с помощью PowerShell (от имени администратора):
Проверяем текущий сервер:
w32tm /query /source
time.windows.com,0x8
Заменяем на нужный сервер времени:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" -Name "NtpServer" -Value "pool.ntp.org,0x8"
После перезапустим службу, чтобы изменения вступили в силу и выполним синхронизацию времени:
Restart-Service w32time
w32tm /resync
Отправка команды синхронизации на локальный компьютер
Команда выполнена успешно.
Готово.
August
8
Problem:
Even logged in as a local admin/or a domain admin on a DC, you can not change local time. It is greyed out
Error showing:” some settings are hidden or managed by your organization”
Solutions:
to correct the time, run timedate.cpl
Related Posts:
- How to find AD users Password Expiration Date and…
- WDS server Error: Windows could not apply the…
- HP Server Ml310 Gen8 shutdown randomly
Posted August 8, 2022 by Ray in category «Windows Server
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Notify me of followup comments via e-mail. You can also subscribe without commenting.
This site uses Akismet to reduce spam. Learn how your comment data is processed.