Language, keyboard and time settings for Windows
First published:
Microsoft has a habit of trying to default to US English and timezones whenever possible, which is obviously not ideal. In order to change this there are quite a few different places that need to be updated.
Windows OOBE and unattend.xml settings
Firstly, when provisioning a new machine, ensure the ISO is of the correct language, and the unattend file (if being used, which you should be!), is setup to choose the correct languages and keyboard on first install. For a UK machine, this will look similar to this:
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64"
publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>en-GB</UILanguage>
<WillShowUI>Never</WillShowUI>
</SetupUILanguage>
<InputLocale>0809:00000809</InputLocale>
<SystemLocale>en-GB</SystemLocale>
<UILanguage>en-GB</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>en-GB</UserLocale>
</component>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<InputLocale>0809:00000809</InputLocale>
<SystemLocale>en-GB</SystemLocale>
<UILanguage>en-GB</UILanguage>
<UserLocale>en-GB</UserLocale>
</component>
</settings>
These two segments can be added to your final XML file.
The language codes and keyboard codes can be found here.
Post provisioning settings
Once the machine is provisioned, you can also use the following powershell script to change the language and keyboard settings:
# Windows 11 and later Install-Language en-GB -CopyToSettings Set-Culture en-GB Set-WinSystemLocale -SystemLocale en-GB Set-WinUILanguageOverride -Language en-GB Set-WinUserLanguageList en-GB -Force Set-WinHomeLocation -GeoId 242 Copy-UserInternationalSettingsToSystem -WelcomeScreen $True -NewUser $True
The language codes and keyboard codes can be found here. A list of geoIDs can be found here.
For users on an active directory, the following attributes can be set to change the language and keyboard settings:
Set-ADUser -Identity $user.SamAccountName -Replace @{
'c' = 'UK';
'co' = 'United Kingdom';
'countryCode' = 826;
'preferredLanguage' = 'en-GB';
'msExchUserCulture' = 'en-GB'
}
Country code is an ISO 3 digit numeric code, a list can be found here.
Office 365 settings
365 timezones are used for things like showing relative time to other users, calender events, etc. The timezone can be set with the following powershell script:
$timezone = "GMT Standard Time"
Connect-ExchangeOnline
$mailboxes = Get-Mailbox -ResultSize unlimited
$totalMailboxes = $mailboxes.Count
$currentMailbox = 0
$mailboxesUpdated = 0
Write-Host "Processing $totalMailboxes mailboxes"
$mailboxes | ForEach-Object {
$currentMailbox++
Write-Progress -Activity "Processing Mailboxes" -Status "Processing mailbox $currentMailbox of $totalMailboxes" -PercentComplete (($currentMailbox / $totalMailboxes) * 100)
$calendarConfig = Get-MailboxCalendarConfiguration -Identity $_.Identity -WarningAction SilentlyContinue
if ($calendarConfig.WorkingHoursTimeZone -ne $timezone) {
Set-MailboxCalendarConfiguration -Identity $_.Identity -WorkingHoursTimeZone $timezone
Write-Host "Updated calendar timezone for $($_.PrimarySmtpAddress)"
$mailboxesUpdated++
}
}
Write-Host "Updated $mailboxesUpdated mailboxes"