Determining Language Locales and values for MDT 2012 with Powershell

by Sean Kearney


Within MDT 2012 (and previous versions) you can pass along to the operating system certain definitions.  One of these is the default keyboard and language locales.   These are defined by the Variables in CustomSettings.ini or your “Rules” Tab in MDT 2012.

The Variables you need to modify are

UILanguage=en-US
UserLocale=0409:00000409
InputLocale= 0409:00000409
KeyboardLocale= 0409:00000409

You will also need to supply the following line as well

SkipLocaleSelection=Yes

To find out the LCID for a French version you can run this line in Windows Powershell

[system.globalization.cultureinfo]::getcultures(“AllCultures”) | where { $_.Displayname –like ‘*french*’ }

the Returned object in your Console which show you ALL Cultures with the name “French” in them.

image

To switch the French Canadian one for example we first alter UILanguage

UILanguage=fr-CA

Our next challenge is figuring out the UserLocale numbers.   What this ACTUALLY is, is a direct reference to the LCID.   The Displayed LCID is in Decimal.   We can test this by taking the first 4 hexadecimal digits from  “UserLocale” and converting them back to decimal with Powershell

[convert]::toint16(“0409”,16)

This returns the decimal value 1033 which if we query the Language locales will confirm this as a en-US configuration.

[system.globalization.cultureinfo]::getcultures(“AllCultures”) | where { $_.LCID –eq 1033 }

image

So all we need to do is convert the LCID value for a French Canadian entry into Hexadecimal and swap in the new values.

[convert]::tostring(3084,16)

This returns a value of c0c.   We just change the hexadecimal values of UserLocale, InputLocale and KeyboardLocale with the updated value for fr-CA

UserLocale=0c0c:00000c0c
InputLocale= 0c0c:00000c0c
KeyboardLocale= 0c0c:00000c0c

Feeling the Power of Automation? I AM !

Sean
The Energized Tech

Leave a Reply