Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

Let’s note that the Time Zone, like Date/Time, is one of the significant parameters of a computer that affects the proper functioning of Windows and various applications. It is recommended to set the Time Zone according to the geographical location of the computer.

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


Here is how this example works:

  • The $current variable contains the current date and time.
  • The $tz variable contains the abbreviated timezone name.
  • Then, we use the -join operator to concatenate these two variables together with a space in between them.

Suppose that our computer is in the Eastern Standard Timezone (EST).

Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

PowerShell Get-Date timezone

The output displays the current date and time along with the timezone:

  • 3/5/2024 8:26:22 AM EST

PowerShell display full timezone name

The output displays the current date and time along with the timezone:

  • 3/5/2024 8:26:22 AM Eastern Standard Time

Feel free to use whichever method you prefer.

How to Compare Dates in PowerShell
How to Format a DateTime in PowerShell
How to Calculate Date Difference in PowerShell

Bulk set Time zone and Language for all mailboxes

You can change the time zone and language settings for all Microsoft 365 mailboxes.

Bulk set Time zone

Change the time zone for all Microsoft 365 mailboxes in a single PowerShell command.

PowerShell command syntax:

$Users = Get-Mailbox -ResultSize Unlimited | % { Set-MailboxRegionalConfiguration $_.Identity -TimeZone <"Time Zone"> }

In our example, we want to bulk set the time zone Pacific Standard Time.

Use the below PowerShell command:

$Users = Get-Mailbox -ResultSize Unlimited | % { Set-MailboxRegionalConfiguration $_.Identity -TimeZone "Pacific Standard Time" }

Bulk set Time zone and Language and Date or Time format

Bulk change all Microsoft 365 mailboxes’ time zone, language, date format, and time format. It will also localize the default folder names in the language you set.

Note: The language and date and time format should always match, or you will get an error. For example, the DateFormat “dd-MM-yyyy” isn’t valid for the current language setting “en-US”. To get the default date and time values, use $null for DateFormat and TimeFormat.

Use the below PowerShell script to bulk set the time zone and language settings for all Microsoft 365 mailboxes.

  • Change the TimeZone in line number 2
  • Change the Language in line number 3
  • Set the DateFormat that matches the language, or type $null for default values in line number 4
  • Set the TimeFormat that matches the language, or type $null for default values in line number 5
$regionalConfigParams = @{
    TimeZone = "W. Europe Standard Time"
    Language = "da-DK"
    DateFormat = "dd-MM-yyyy"
    TimeFormat = "H:mm"
    LocalizeDefaultFolderName = $true
}

Get-Mailbox -ResultSize Unlimited | 
    Set-MailboxRegionalConfiguration @regionalConfigParams

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

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

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

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

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

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

Set-TimeZone -Name "Astrakhan Standard Time"

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

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

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

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

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

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

Russian Standard Time

tzutil /g узнать текущий часовой пояс компьютера

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

tzutil /l список всех часовых поясов

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

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

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

tzutil /s задать часовой пояс Russia Time Zone

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

reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

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

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

tzutil /s "Pacific Standard Time_dstoff"

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

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

w32tm /tz

Display information Time zone and Language

Get a list of time zones and languages for every Microsoft 365 mailbox.

Display list of Time zones

Use the below PowerShell command to view a list of all time zones.

Get-ChildItem "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Time zones" | Format-List pschildname

Display Time zone and Language information for specific mailbox

You can display a specific mailbox time zone, language, date, and time format settings.

PowerShell command syntax:

Get-MailboxRegionalConfiguration <Identity>

Run the PowerShell command example:

Get-MailboxRegionalConfiguration "amanda.hansen@m365info.com"

See the below PowerShell output:

PS C:\> Get-MailboxRegionalConfiguration "amanda.hansen@m365info.com"

Identity             Language        DateFormat TimeFormat TimeZone
--------             --------        ---------- ---------- --------
41377e9c-dc47-46c... en-US           M/d/yyyy   h:mm tt    Pacific Standard Time

Display Time zone and Language information for all Microsoft 365 mailboxes

You can also display all Microsoft 365 mailboxes with time zone, language, date, and time format information.

Run the below PowerShell command:

Get-Mailbox -ResultSize Unlimited | Get-MailboxRegionalConfiguration

The PowerShell output looks like the below example:

PS C:\> Get-Mailbox -ResultSize Unlimited | Get-MailboxRegionalConfiguration

Identity             Language        DateFormat TimeFormat TimeZone                                              
--------             --------        ---------- ---------- --------                                              
41377e9c-dc47-46c... en-US           yyyy-MM-dd h:mm tt    Pacific Standard Time                                 
d912b0fc-6f7e-4ec... en-US           yyyy-MM-dd h:mm tt    Pacific Standard Time                                 
Catch All            da-DK           dd-MM-yyyy H:mm       W. Europe Standard Time                               
fa956d8c-87df-4cd... da-DK           dd-MM-yyyy H:mm       W. Europe Standard Time                               
eec2668a-0773-494... en-US           yyyy-MM-dd h:mm tt    Pacific Standard Time

Using the Get-TimeZone Command

The Get-TimeZone command in PowerShell allows us to retrieve the current timezone information in Windows. This command provides various properties related to the timezone, such as the timezone ID, display name, and standard time offset.

  1. Open PowerShell by typing “PowerShell” in the Windows search bar and selecting the “Windows PowerShell” app.
  2. In the PowerShell window, type the following command:
Get-TimeZone

Press Enter to execute the command.

:/>  Как посмотреть что использует камеру

The output of the Get-TimeZone command will display the timezone information for your Windows system. It will include properties such as the timezone ID, display name, and standard time offset.

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

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

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

Другой способ настроек времени заключается в импорте содержимого ветки 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

Connect to Exchange Online PowerShell

To be able to run the PowerShell commands, you will need to Connect to Exchange Online PowerShell.

Connect-ExchangeOnline

Table of contents

We will show you how to manage the time zone and language settings for:

  • Single user mailbox
  • Multiple user mailboxes
  • Bulk all user mailboxes

Additional Information

The Get-TimeZone command provides various additional properties that can be accessed to retrieve specific information about the timezone. Some of the commonly used properties include:

  • Id: The timezone ID, which uniquely identifies the timezone.
  • DisplayName: The display name of the timezone.
  • StandardName: The standard name of the timezone.
  • DaylightName: The daylight saving time name of the timezone.
  • BaseUtcOffset: The standard time offset from Coordinated Universal Time (UTC).
  • SupportsDaylightSavingTime: Indicates whether the timezone supports daylight saving time.

By accessing these properties, you can retrieve specific information about the timezone in Windows using PowerShell.

The scripts

Below are the remediation and detection scripts for Intune. Save them somewhere and use them in Intune. And yes, they are long because of the timezone table, which I use to convert the IANA naming (Left side) to the Windows timezone setting. (Right side).

Detection.ps1

Remediation.ps1

Download the script(s) from GitHub here.

Granting permissions to change the time zone in Windows.

Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

Limitations

When you deploy the script, you could run into these limitations:

  • The timezone will be set based on the device’s public IP at the time of deployment or whenever the remediation script runs. If the device is VPN-connected using a full tunnel instead of a split tunnel configuration, the timezone may not be what you expect. Depending on its registration, the internet provider’s public IP may also put you in another timezone.
  • I viewed and tried other examples of retrieving the timezone using Azure Maps. That also works but allows only 5K monthly requests on the free tier. The script uses the free ident.me service, and perhaps this is something your company policy might not allow.

Настройка часового пояса через панель управления 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.
Продолжение невозможно. У вас нет разрешения на выполнение этой задачи. Обратитесь за помощью к сетевому администратору.

Не удается задать часовой пояс в Windows Server 2019 Продолжение невозможно. У вас нет разрешения на выполнение этой задачи

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

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

How does the script work?

I created two scripts that can be used in Intune. One only sets the timezone once using the Scripts pane under the Devices pane. The other is a remediation detection script that will detect the current location and time zone and compare it to the one configured on the Windows device. If it differs, it will run the first script and configure the Windows timezone accordingly.

The script uses the ident.me website (Thanks Stephan van Rooij for pointing out that free to use website, i previously used one that allowed 50K free requests per month) to detect the current location of the Windows device based on the public IP information. The site will return details, including the IANA (Internet Assigned Numbers Authority) timezone name of the location found. (Europe/Amsterdam, for example). The script uses that to configure the matching Windows timezone name by looking it up in a PSCustomObject table, which is included in the script.

If the ident.me website can’t be reached, the Detection script will report that in the logs; it will try again later and return the Exit 0 code. The reason is that if the site ident.me can’t be reached, the Remediation script will also not be able to reach it and can remediate the timezone at that moment.

:/>  Лечение вирусов на флешке

Example output when using the ident.me website: (I changed the values for privacy reasons 😉 )

ip        : 123.123.123.123
aso       : Fiber Company
asn       : 123456
continent : EU
cc        : NL
country   : The Netherlands
city      : Where I live
postal    : 1234
latitude  : 54.321012
longitude : 5.123456
tz        : Europe/Amsterdam

Example

Before Autopilot deployment:

Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

After Autopilot deployment:

Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

Example 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

In the example output above, the timezone ID is “Pacific Standard Time,” the display name is “(UTC-08:00) Pacific Time (US & Canada),” and the standard time offset is “-08:00:00.”

Set Time zone and Language for single mailbox

To change the time zone and language settings for a single mailbox, we will use the Set-MailboxRegionalConfiguration PowerShell cmdlet.

Set mailbox Time zone

Change the time zone for a single Microsoft 365 mailbox.

PowerShell command syntax:

Set-MailboxRegionalConfiguration "Identity" -TimeZone "Time Zone"

PowerShell command example:

Set-MailboxRegionalConfiguration "amanda.hansen@m365info.com" -TimeZone "Pacific Standard Time"

Set mailbox Language and Date or Time format

If you set a mailbox language, you must also change the date and time format to avoid errors.

Note: You will get a PowerShell error if you set a language for a mailbox that has a different date or time format.

A PowerShell error message appears when the date format is invalid for the current language setting.

Ex328A48|Microsoft.Exchange.Data.DataValidationException|DateFormat \"dd/MM/yyyy\" isn't valid for current language setting \"en-US\". Valid formats include \"M/d/yyyy, M/d/yy, MM/dd/yy, MM/dd/yyyy, yy/MM/dd, yyyy-MM-dd, dd-MMM-yy\"."

A PowerShell error message appears when the time format does not match the current language setting.

Ex402B93|Microsoft.Exchange.Data.DataValidationException|The TimeFormat \"h:mm tt\" isn't valid for current language setting \"da-DK\". Valid formats include \"HH:mm, H:mm\"."

Note: Each language has its own valid value for date format and time format. If you receive the above errors (Dateformat or the Timeformat isn’t valid for the current language setting), you can set DateFormat and Timeformat to value $null. This will set the date and time format to the default format for that specific language.

  • Date format: day-month-year
  • Time format: HH:mm
  • Localize the default folder names: Danish

Set the -DateFormat $null and -Timeformat $null to get the default value format for the language.

PowerShell command syntax:

Set-MailboxRegionalConfiguration "Identity" -Language "language-country" -DateFormat "dd-MM-yyyy" -TimeFormat "HH:mm" -LocalizeDefaultFolderName

Use the below PowerShell example:

Set-MailboxRegionalConfiguration "amanda.hansen@m365info.com" -Language "da-dk" -DateFormat "dd-MM-yyyy" -TimeFormat "HH:mm" -LocalizeDefaultFolderName

Set mailbox Time zone and Language and Date or Time format

You can change the time zone, language, date, and time format for a single mailbox with a PowerShell cmdlet.

Note: You will get an error if you set a language for a mailbox with a different date format or time format. Always check which time and date format matches the language you want to set or use $null to get the default value.

  • Time zone: Greenwich Standard Time
  • Language: English – Great Brittain
  • Date format: dd/MM/yyyy or $null
  • Time format: h:mm tt or $null
  • Localize the default folder names: English

PowerShell command syntax:

Set-MailboxRegionalConfiguration "Identity" -TimeZone "Time Zone" –Language "language-country" -DateFormat "dd/MM/yyyy" -TimeFormat "h:mm tt" -LocalizeDefaultFolderName

Run the below PowerShell example:

Set-MailboxRegionalConfiguration "amanda.hansen@m365info.com" -TimeZone "Greenwich Standard Time" –Language "en-GB" -DateFormat "dd/MM/yyyy" -TimeFormat "h:mm tt" -LocalizeDefaultFolderName

Set Time zone and Language for multiple mailboxes from CSV

To set the time zone and language settings for multiple mailboxes, you need to create a single CSV file.

Create CSV file

Open Notepad or Microsoft Excel and type a list of the mailboxes you want to change their time zone and language.

  1. Type UPN at the top
  2. All the mailboxes
Manage set mailboxes Time zone and Language settings with PowerShell create CSV file
  1. Create the folder temp if you don’t have it already in the (C:) drive
  2. Name the file UsersList.csv
  3. Save as type All files (*)
  4. Click Save
Manage set mailboxes Time zone and Language settings with PowerShell save CSV file

Set multiple mailboxes Time zone

First, you need to create a CSV file and list the mailboxes in a single column named UPN, as shown in the previous step.

We will set the time zone to Pacific Standard Time for multiple Microsoft 365 mailboxes from the CSV file.

Use the below PowerShell script to change the time zone.

  • Change the TimeZone in line number 2
# Time zone
$TimeZone = "Pacific Standard Time"

# Import the CSV file containing user information
$users = Import-Csv "C:\temp\UsersList.csv" -Encoding UTF8

# Go through each user in the CSV file
foreach ($user in $users) {

    # Retrieve the user's User Principal Name (UPN) from the CSV
    $userUPN = $user.UPN

    # Set the mailbox regional configuration for the user
    Set-MailboxRegionalConfiguration -Identity $userUPN -LocalizeDefaultFolderName: $true -TimeZone $TimeZone 
}

Set multiple mailboxes Time zone and Language and Date or Time format

First, you need to set up a CSV file and list the mailboxes in a single column named UPN, as shown in the first step.

We will change the time zone, language, date, and time format for multiple mailboxes from the CSV file.

Note: The language you want to set must match the date format and time format, or you will get an error. If you don’t know the valid format for a language, use $null to get the default date and time values.

Use the below PowerShell script to change the time zone and language settings.

  • Change the TimeZone in line number 3
  • Change the Language in line number 4
  • Set the DateFormat that matches the language, or type $null for default in line number 5
  • Set the TimeFormat that matches the language, or type $null for default in line number 6
# Define regional configuration parameters
$regionalConfigParams = @{
    TimeZone                  = "Central Europe Standard Time"
    Language                  = "da-DK"
    DateFormat                = "dd-MM-yy"
    TimeFormat                = "HH:mm"
    LocalizeDefaultFolderName = $true
}

# Import the CSV file containing user information
$users = Import-Csv "C:\temp\UsersList.csv" -Encoding UTF8

# Go through each user in the CSV file
foreach ($user in $users) {

    # Retrieve the user's User Principal Name (UPN) from the CSV
    $userUPN = $user.UPN

    # Set the mailbox regional configuration for the user using splatting
    Set-MailboxRegionalConfiguration -Identity $userUPN @regionalConfigParams
}

Deploying the script in Intune

Using it as a one-time script

Below are the steps for adding the script to Intune and letting it run once for the device:

  • Go to the Scripts pane in Intune Devices – Microsoft Intune admin center.
  • Select Add
  • Select Windows 10 and later
  • Enter a Name (Timezone configuration, for example.)
  • Enter a Description (Automatic timezone configuration using ident.me, for example)
  • Select Next
  • Click on Select a file and browse to the script that you copied from this page.
  • Change the Run this script using the logged on credentials value to No (It must run as System)
  • Change the Enforce script signature check to No
  • Leave the Run script in 64 bit PowerShell Host to its default value of No
  • Select Next
  • Configure a Scope Tag if needed and select Next.
  • Select Add groups, and assign it to the group(s) containing the devices.
  • Select Next and review the settings.
  • Select Add to add the script to Intune.
:/>  Код ошибки 0xc004f074: как исправить в Windows 10 и 4 способа провести активацию

Using it as a Remediation

Below are the steps for adding the scripts to Intune as a Remediation: (You can only use the scripts as a Remediation with the correct licensing)

  • Go to the Remediation pane in Intune Devices – Microsoft Intune admin center
  • Select Create script package
  • Enter a Name (Timezone configuration, for example.)
  • Enter a Description (Automatic timezone configuration using ident.me, for example)
  • Enter a Publisher (PowerShellisfun, for example)
  • Select Next
  • Click on Select a file for the Detection script file and browse to the detection script you copied from this page.
  • Click on Select a file for the Remediation script file and browse to the remediation script you copied from this page.
  • Leave the settings values to No for the Run this script using the logged-on credentials, Enforce script signature, and Run script in 64-bit PowerShell.
  • Select Next
  • Configure a Scope Tag if needed and select Next.
  • Select Select groups to include, and assign it to the group(s) containing the devices.
  • After adding the group(s), it will run daily by default at 1:00:00 AM every day for each group. You can change it by clicking on Daily and changing the time to 12:00:00 PM, for example, or to hourly with a repetition of X hours.
  • Select Next and review the settings.
  • Select Create to add the custom remediation script to Intune.

Export all Microsoft 365 mailboxes Time zone and Language details to CSV

You can also export the time zone and language settings for all Microsoft 365 mailboxes to a single CSV file. This way, you can easily search which language each mailbox has.

Run the below PowerShell command to bulk export mailboxes to a CSV file.

$exportPath = "C:\Temp\File.csv"

$csvData = Get-Mailbox -ResultSize Unlimited | ForEach-Object {
    $mailbox = $_
    $regionalConfig = Get-MailboxRegionalConfiguration -Identity $mailbox.Identity

    [PSCustomObject]@{
        UserPrincipalName = $mailbox.UserPrincipalName
        Name = $mailbox.Name
        TimeZone = $regionalConfig.TimeZone
        Language = $regionalConfig.Language
        DateFormat = $regionalConfig.DateFormat
        TimeFormat = $regionalConfig.TimeFormat
    }
}

$csvData | Export-Csv -Path $exportPath -NoTypeInformation -Encoding UTF8

Find the CSV file in the C:\temp folder. Open the CSV file with an application like Microsoft Excel to see the results.

Manage set mailboxes Time zone and Language settings with PowerShell Export CSV file

Changing Time Zone in Windows / Windows Server.

Changing Time Zone in the graphical interface of Windows

In Windows 10 and Windows Server 2019/2016 operating systems, to configure the time and time zone, you can:

– 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;

Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell
Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

*By default, the ‘Set time automatically’ option will be checked. You can disable this option and manually choose the desired time zone from the drop-down list.

– run timedate.cpl from the cmd , and it will open the Windows time settings window where you can specify the Time Zone through the ‘Change time zone’ button.

Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

Changing Time Zone from the cmd using the TZUtil utility

Open a command line  cmd.exe
* we note that the utility tzutil.exe  suitable for Windows 10/11, Windows Server 2016/2019/2022
First, determine the current time zone and its identifier (TimeZoneID). To do this, enter the command:

tzutil /g
Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell
tzutil /l
Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

You can also find an up-to-date list of time zones Windows from Microsoft

tzutil /s "GTB Standard Time"


In the Windows registry, you can check the current time zone:

reg query HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

To disable daylight saving time for a specific zone, you must specify the time zone identifier with the ending: _dstoff

tzutil /s "GTB Standard Time_dstoff"
 w32tm /tz
Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

Changing the time zone using PowerShell

 [TimeZoneInfo]::Local
Get-TimeZone
Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell
Get-TimeZone -ListAvailable
[System.TimeZoneInfo]::GetSystemTimeZones()
Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

The list of all time zones is quite large, so for convenience we recommend using the filter where you specify part of the name, for example:

Get-TimeZone -ListAvailable | Where-Object {$_.Id -like "*FLE*"}
Управление часовым поясом и языковыми настройками почтового ящика с помощью power shell

To change the current time zone from the PowerShell console, type the command:

 Set-TimeZone -Name "FLE Standard Time"

*specify the name of the desired time zone in quotes.

Conclusion

You learned how to manage mailbox time zone and language settings in Exchange Online with PowerShell. When you set the language for a mailbox, always change the date and time format to avoid errors in PowerShell. Remember to display a list of all Microsoft 365 mailboxes’ time zone and language information or export it to a CSV file and verify it looks good.

Conclusion

Next time you need to retrieve the timezone in Windows, give the Get-TimeZone command in PowerShell a try!

Оставьте комментарий