Set Language and Time Zone for Office 365 Users using PowerShell 

Set Language and Time Zone for Office 365 Users using PowerShell

When a user opens their mailbox for the first time, it will show a prompt to select the time zone and language to get a personalized experience. Also, mailbox users can change their regional settings any time from OWA.

In some situations, Office 365 admins may want to configure language and time zone for users. For example,

  • When admins want to set pre-defined regional settings.
  • When mailboxes are set to the wrong language during migration.
  • When users’ time zone settings are incorrect or missing.

Admins can set language and time zone easily using PowerShell, and this blog will guide you on configuring regional settings for mailboxes through multiple use cases.

Set Language and Time Zone for Office 365 Mailboxes:

The Set-MailboxRegionalConfiguration cmdlet is used to set and modify the regional settings like date format, time format, time zone and language. To know a list of supported formats for each regional setting, you can refer to the bottom of the blog.

This blog will help admins to configure language and time zone for mailboxes based on the multiple use cases.

  1. Set language and time zone for a single user
  2. Configure language and time zone for bulk users through input CSV
  3. Set language and time zone for all users in Microsoft 365

Note: You must install Exchange Online PowerShell module before running the below cmdlets and scripts.

Set Time Zone and Language for a Single User:

To set time zone, run the following cmdlet.

Set-MailboxRegionalConfiguration –Identity <UPN> -TimeZone <”Time Zone”> 

For example,

Set-MailboxRegionalConfiguration –Identity [email protected] -TimeZone "GMT Standard Time” 

The above example sets GMT standard time for Kathy’s mailbox.

To set language for a Office 365 mailbox, run the following cmdlet.

Set-MailboxRegionalConfiguration –Identity [email protected] -TimeZone "GMT Standard Time” -Language da-dk 

This example sets Kathy’s mailbox language to Danish Denmark and time zone to GMT standard time.

Along with the time zone and language, you can also set date format and time format. For example.

Set-MailboxRegionalConfiguration –Identity [email protected] -TimeZone "GMT Standard Time” -Language da-dk -DateFormat "dd/MM/yyyy" -TimeFormat H:mm 

Note: You have to set the supported date format for the corresponding language. Else, you will get the “Date format isn’t valid for current language setting” error. To avoid this issue, you can set $null for DateFormat and TimeFormat. It will set the date and time format to the default value for the given language. For example,

Set-MailboxRegionalConfiguration -Identity [email protected] -Language es-ar -DateFormat $null -TimeFormat $null -LocalizeDefaultFolderName 

It will set Kathy’s mailbox language to Spanish Argentina, date & time format to default value for es-ar, and localizes the default folder names in Spanish.

Configure Language and Time Zone for Bulk Users:

To change the time zone and language for multiple users through CSV input, you can use the below code snippet.

Connect-ExchangeOnline 
Import-CSV <FilePath> | foreach {     
 $UPN=$_.UPN     
 Write-Progress -Activity "Configuring regional settings to $UPN..."    
 Set-MailboxRegionalConfiguration –Identity $UPN -TimeZone <"TimeZone”> -Language <Language> 
 If($?)     
 {     
  Write-Host $UPN - Successfully configured -ForegroundColor Green    
 }     
 Else     
 {     
  Write-Host $UPN - Error occurred –ForegroundColor Red    
 }     
} 

Before executing the script, you must replace the following values.

<FilePath> – Mailbox names CSV file path

<TimeZone> – Required time zone value inside the double quotes

<Language> – Required language

The input CSV should follow the format below.

Bulk user import through CSV

Set Language and Time Zone for All OWA Users:

To configure/change regional settings for all mailboxes in Microsoft 365, you must get mailboxes using the Get-Mailbox cmdlet. Then, you have to set regional settings for each mailbox.

To set regional settings for all the mailboxes,

Get-Mailbox –ResultSize Unlimited | Set-MailboxRegionalConfiguration –TimeZone <”TimeZone”> -Language <Language> 

View Regional Settings for Office 365 Mailboxes:

The Get-MailboxRegionalConfiguration cmdlet used to show the regional configuration of mailboxes.

To get regional settings details for a specific mailbox, run the following cmdlet.

Get-MailboxRegionalConfiguration -Identity [email protected] 

To view regional settings for all mailboxes,

Get-Mailbox –ResultSize Unlimited | Get-MailboxRegionalConfiguration 

To export all mailboxes and their language & time zone settings, execute the cmdlet below.

Get-Mailbox –ResultSize Unlimited | Get-MailboxRegionalConfiguration | Export-CSV <FilePath> -NoType 

Regional Settings – Supported Formats:

  • Time Zone:

To get valid time zone formats, you can refer to the Microsoft doc or run the following PowerShell code.

$TimeZone = Get-ChildItem "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Time zones" | foreach {Get-ItemProperty $_.PSPath}; $TimeZone | sort Display | Format-Table -Auto PSChildname,Display 

  • Language:

To get languages and their locale code, you can refer to the Microsoft doc. If you want to use the locale name, you can check here.

  • Date Format and Time Format:

Each language has its own valid date & time format. If you receive “Invalid DateFormat values” error, you can set DateFormat and TimeFormat to $null value. It will set date and time format to default format for that specific language.

I hope this blog will help admins to change language and time zone in Office 365 mailboxes.

Set Language and Time Zone for Office 365 Users using PowerShell 

by Kathy time to read: 3 min
0