Home > Uncategorized > Regional Settings depending on first 3 letter in computername in a task sequence.

Regional Settings depending on first 3 letter in computername in a task sequence.


Hello.

So i wanted to set regional settings depending on the first 3 letter in the computer name when i deploy it, the best way i found was to use a XML and set it with the control.exe command for example control.exe intl.cpl,, /f:”%temp%\Denmark.xml”

This way i can set keyboard layout, location and format.

this is what the task sequence looks like.

Image

And under Options of each group i have a WMI query to check the first 3 letter in the name

SELECT * FROM Win32_ComputerSystem WHERE Name Like “XXX%”

i Created 2 files, one XML file containing the country codes and one cmd file that copies the file locally and then executes it, for some reason just a “Run Command” step did not work.

the cmd is very simple, it copies the xml file from the DP to the temp folder. and then runs the control.exe command notice the dp0 has no \ as it is already included in the variable.

copy %~dp0Sweden.xml %temp%\Sweden.xml
control.exe intl.cpl,, /f:”%temp%\Sweden.xml”

This is what the step looks like

Capture

The XML file was a little bit trickier as it contains different country codes, the GeoID, sv-SE, and an ID, and you can ofcourse add multiple “InputLanguageID” if you want more keyboard layouts.

<gs:GlobalizationServices xmlns:gs=”urn:longhornGlobalizationUnattend”>
<!– user list –>
<gs:UserList>
<gs:User UserID=”Current” CopySettingsToDefaultUserAcct=”true” CopySettingsToSystemAcct=”true”/>
</gs:UserList>
<!– GeoID –>
<gs:LocationPreferences>
<gs:GeoID Value=”221″/>
</gs:LocationPreferences>
<!– UI Language Prefernces –>
<gs:MUILanguagePreferences>
<gs:MUILanguage Value=”sv-SE”/>
<gs:MUIFallback Value=”en-GB”/>
</gs:MUILanguagePreferences>
<!– system locale –>
<gs:SystemLocale Name=”SV-SE”/>
<!– input preferences –>
<gs:InputPreferences>
<gs:InputLanguageID Action=”add” ID=”041d:0000041d”/>
<gs:InputLanguageID Action=”remove” ID=”0409:00000409″/>
</gs:InputPreferences>
<!– user locale –>
<gs:UserLocale>
<gs:Locale Name=”sv-SE” SetAsCurrent=”true” ResetAllSettings=”true”>
</gs:Locale>
</gs:UserLocale>
</gs:GlobalizationServices>

GeoID you can find here but you need to use a HEX to Decimal converter to get what you want.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd374073(v=vs.85).aspx

And here are the Locale ID:s

http://msdn.microsoft.com/en-us/goglobal/bb895996.aspx

here is a little more info on how to write the XML file

http://msdn.microsoft.com/en-us/goglobal/bb964650

 

When you have created all the XML files and CMD files but them in your source folder and create a package from it. you dont need to create a program.

5

As a last step in the regional settings group i have a rule that sais if the first 3 letters are NOT any of for example XXX, CCC, FFF it will set Swedish

Image

Advertisements
Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: