Configuring Regional and Language Settings Online in an MDT Task Sequence
Update 2015-02-27: I have updated the script. Read about the changes here: https://blogs.technet.com/b/deploymentguys/archive/2015/02/27/configuring-regional-and-language-settings-online-in-an-mdt-task-sequence-script-update.aspx. Both posts now have the updated script download. |
I had a customer who wanted to install the operating system language packs as a dynamic online application installation in the ConfigMgr task sequence based on the region where the client was deployed. Because of this, they wanted to change the locale settings (UI language, keyboard layout, etc.) dynamically after the language pack was installed.
MDT has the properties UserLocale, SystemLocale (XP/2003), InputLocale (XP/2003), KeyboardLocale (Vista and higher), and UILanguage for configuring locale settings. (Note that SystemLocale is only a standard property in MDT 2010 and later. SystemLocale must be added as a custom property for versions of MDT before 2010.) However, these are only used by MDT to configure these settings in the answer file (Sysprep.inf or Unattend.xml) offline when the operating system image is applied.
To configure these settings online requires using a control panel command with a special answer file that just has locale settings. These are documented here for Window XP/2003 and Windows Vista and higher:
How to create the regional and language settings for an unattended installation of Windows MultiLanguage Version
https://support.microsoft.com/?id=289125Windows Vista Command Line Configuration of International Settings
https://msdn.microsoft.com/en-ie/goglobal/bb964650(en-us).aspx
So I created the attached script for Windows XP and Windows Vista to run after the MUI Pack install. I put this script together right at the end of the engagement (last minute customer request) so it did not get much testing. I haven’t tried it with Windows 7 but it should work since XML file used should be the same as Windows Vista. If you encounter problems, please post comments.
This script uses the MDT Properties above and a custom property called GeoID (Vista and higher) to create the appropriate XML or INF settings file (named RegionalOptions.log) and then runs the appropriate command with intl.cpl. (If SystemLocale is not specified, then the value of UserLocale is used for that.) You could expand this script to handle other settings using the references links found above.
Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .
This post was contributed by Michael Murgolo, a Senior Consultant with Microsoft Services - U.S. East Region.
Comments
Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
Denniz, This is likely occurring due to file system redirection on Windows x64 (msdn.microsoft.com/.../aa384187(v=VS.85).aspx). Since the ConfigMgr Task Sequencer is 32-bit, the version of cscript.exe (and hence control.exe launched by the script) will be the 32-bit version. This version may not work. Try disabling 64-bit file system redirection for that Task Sequence step (technet.microsoft.com/.../bb632992.aspx). Michael MurgoloAnonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
Hi Michael, I am now using your script and it works just fine with Windows 7 x86, but when I am running it in a task sequence that installs Windows 7 x64 it don't! Do I have to make something else to get it to work with x64 Windows? BR DennisAnonymous
January 01, 2003
Filipe, Are you running this from an elevated command prompt? Is the file "C:MININTSMSOSDOSDLOGSRegionalOptions.log" being created and does the contents look like valid XML? Check the event log per the instructions in the Logging section of Vista link in the post above. You could also try running the command directly. Without deleting the C:MININT folder (so that the file "C:MININTSMSOSDOSDLOGSRegionalOptions.log" remains there) try running the command directly in an elevated command prompt. control.exe intl.cpl,,/f:"C:MININTSMSOSDOSDLOGSRegionalOptions.log" Michael MurgoloAnonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
Hi Michael, I'm using the control.exe intl.cpl to set the language during the user deployment in a task sequence. The problem that I got is, that the local account NT-AUTORITHY is renamed to NT-AUTORITÄT which the causes an error during SQL server installation. OS is Vista, Language in de-DE. Do you have any idea how to modify the xml file to not rename this account but have a German user interface for all new users? Thanks in advance Cheers FrankAnonymous
January 01, 2003
Hi Michael! I have tried your script in my SCCM environment and it always fails with an error that it cannot change UI Language to sv-SE! First I install the Windows 7 language pack as a ConfigMgr Package andt it gets installed ok. Then I want to change the Default Display Language with your script. I have tried to run it as both:
- Run Commandline in my TS right after "Install Software" in the Restore Phase
- I have also tried to create a ConfigMgr software package with the script and a copy of ZTIUtility.vbs the command i use is: cscript //nologo RegionalSettings.wsf /UserLocale:sv-SE /SystemLocale:sv-SE /KeyboardLocale:"041d:0000041d;0409:00000409" /UILanguage:sv-SE /GeoID:221 It always fails with error 1. The event log says it cannot change the UI Language to sv-SE. Is it important where in the TS I put the script or is there problem with the credentials that the TS uses (SYSTEM) cannot change the UI Language? Im kind a stuck here and desperate for mor information on how this script should be used. Kind Regards Denniz
Anonymous
January 01, 2003
smartie, Yes, you can create your own XML file and run it directly with control.exe. Michael MurgoloAnonymous
January 01, 2003
Thanks BH and imp0z for pointing out that bug. I've attached an updated version with you fix. Michael MurgoloAnonymous
January 01, 2003
qb, You were not clear if the sample you provided works or not. Also, do you actually have the language pack installed? Michael MurgoloAnonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
qb, Very interesting. I'm going to pass this along internally and see if I can get confirmation that this should work for Windows 7. Thanks for letting me know. Michael MurgoloAnonymous
January 01, 2003
Robin Hearne, You did not state how you are running the command when it fails. How are you kicking off the command if it is not on the local PC? Michael MurgoloAnonymous
January 01, 2003
Hello Michael. Thanks for the script, it's just what I needed to deploy 10 language versions of winodws 7. I use SCCM and OSD to deploy O.S.ses. A problem I have is: I use an image with all languages imported in it, and it keeps coming up with the language choice option even though the TS runs succesfully. Also, the task step itself returns a return code 1 in the regionalsettings.log, but is run it after the TS finishes, it does work fine. My question: If I use this script in OSD in SCCM, at what point in the task sequence should I put this task. Thanks in advance, Michel van den BergAnonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
qb, This script is designed to be used with MDT. It requires ZTIUtility.vbs to be in the same folder to work (put the script in the MDT "Scripts" folder) and all the MDT properties I mentioned populated. Did you do this? Running the command by itself will do nothing. A Gather step must run in the task sequence before this is run. Did the script generate any logs (RegionalSettings.log or RegionalOptions) where the MDT logs are created (LTI - C:MinintSMSOSDOSDLOGS or ZTI - C:WindowsSystem32CMMLogs, C:WindowsSystem32CMMLogsSmstslog). Michael MurgoloAnonymous
January 27, 2010
Hi Michael, Thanks for this posting. Can you please let me know how can i achieve below items. I am using MDT intagrated with SCCM to install XP+Sp2 via ZTI. In my scenario customer wants the installation to be get stopped at two location
- Regional Settings
- Computer Name After giving the proper regional settings and computer name, installation should proceed. Can you please suggest how can i achieve this in ZTI. Where should i modify for this? Regards, Renjith.
Anonymous
January 29, 2010
Hi Michael, This didn't work for Windows 7. Even I tried running the command in OS didn't make any difference. It doesn't give any error messages or output. I guess command silently fails even if something is wrong. ThanksAnonymous
February 02, 2010
Hi Michael, Sorry I wasn't clear enough. Your script runs with no problems. The log files get created and the TS step exits out with no failure. The command that I am reffering to is control intl.cpl,, /f:"filename.xml". I am not sure if the syntax has changed from Vista to Windows 7. Here is the sample xml that I use for changing the UIlanguage. <gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend"> <!--User List--> <gs:UserList> <gs:User UserID="Current"/> </gs:UserList> <!—Display Language--> <gs:MUILanguagePreferences> <gs:MUILanguage Value="fr-FR" /> <gs:MUIFallback Value="en-US" /> </gs:MUILanguagePreferences> </gs:GlobalizationServices>Anonymous
February 02, 2010
Michael, I do have the language pack installed. I just tested on Vista and sample XML file that I posted earlier, in fact, changed the UI language. Still no luck on Windows 7 ThanksAnonymous
February 17, 2010
Works like a charm! Thanks a bunch MichaelAnonymous
April 13, 2010
The comment has been removedAnonymous
May 05, 2010
Hei Michael Murgolo, For the problems getting this to work on Win7/Vista the xml file needs to be closed before running it with intl.cpl. You are missing an oFile.Close before running the command. Add that and the script will work fine: oFile.WriteLine "</gs:GlobalizationServices>" ---Here you need oFile.Close sCmd = "cmd /c control.exe intl.cpl,,/f:" & chr(34) & sFile & Chr(34)Anonymous
July 20, 2010
I don't have MDT in my environment so I'm trying to set the regional settings using a pre-prepared XML file simply by running the following command: control.exe c:windowssyswow64intl.cpl,, /f:"c:tempEnglish.xml" However it fails with exit code 1. The same command works fine if I run it locally on the PC. Any ideas what I need to do to get this to work? Regards, RobinAnonymous
July 21, 2010
The comment has been removedAnonymous
January 13, 2011
Thanks for the posting!!! This is exactly what I needed to complete a LTI interface that needed to set regional settings in the SCCM ZTI process. I have seperated the inis to look like ja-JP.ini, es-es.ini, etc, etc.. and put the corressponding regional settings. I call to each setting via the task sequence using the cscript provided. You are the man! J.V.Anonymous
February 02, 2011
I'm trying to run your script from a local directory, i've copied the files Regionalsettings.wsf and ZTIUtility.vbs. Then i've run the command: cscript //nologo RegionalSettings.wsf /UserLocale:es-VE /SystemLocale:es-VE /KeyboardLocale:"200a:0000200a;0409:000000409" /UILanguage:es-VE /GeoID:249 The script is returning "ERROR running command "cmd /c control.exe intl.cpl,,/f:"C:MININTSMSOSDOSDLOGSRegionalOptions.log" , rc = 1 Am i doing anything wrong? ThanksAnonymous
February 11, 2011
The comment has been removedAnonymous
February 11, 2011
Hi Michael In my Windows7 Multilingual with german and french language package installed i tried the folllowing syntax. script //nologo RegionalSettings.wsf /UserLocale:de-CH /SystemLocale:de-CH /KeyboardLocale:"0807:00000807;0807:00000807" /UILanguage:de-DE GeoID:0xDF Unfortunatelly UILanguage didn't change to german. Why this? And i don't know if 0xDF is the correct GeoID. Where can i find the correct GeoID for Switzerland? Regards RamonAnonymous
March 10, 2011
there will be a large amount of event logs for each Server. This Task is scheduled on every day. To verify each servers last event log would be a long process. Caddy Angelica http://www.caddylife.info/ Author follow me : twitter.com/caddyangelicaAnonymous
September 13, 2011
Michael, Is there a limit to the number of input locals you can select and still have it work properly?Anonymous
November 08, 2011
Michael, I have machines where all the Region and Language settings have been changed to Canadian. I have managed to use your examples to change every feature with the exception of one. Where I am running into problems is with the removal of the "English(Canada)" Input keyboard. It the following additional language listed below it "US", "Canadian Multilingual Standard", and "Canadian French". I have the following lines added to remove theses keyboards and add "English(US)" keyboard: <gs:InputLanguageID Action="remove" ID="1009:00001009"/> <gs:InputLanguageID Action="remove" ID="11009:00011009"/> <gs:InputLanguageID Action="remove" ID="0409:00000409"/> <gs:InputLanguageID Action="add" ID="0409:00000409" Default="true"/> I get an error when using "11009" for the "Canadian Multilingual Standard", it says it doesn't match its regular expression. Any ideas where I might be going wrong?Anonymous
July 02, 2013
The comment has been removedAnonymous
February 05, 2014
The comment has been removedAnonymous
February 27, 2015
A few years ago I authored a post about this topic. You can find it here . I recently had an engagement