Forum Discussion
Intune auto pilot international settings
- Mar 31, 2022Rudy_Ooms_MVP thanks for your help. My xml was wrong. I ended up creating a different app with a CMD file in it and the xml inside the win32 package. I also separated the PowerShell script to add the language to a different win32 package. For anyone requiring something similar here is my xml: <gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend"> <gs:UserList> 
 <gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/>
 </gs:UserList><!-- GeoID --> 
 <gs:LocationPreferences>
 <gs:GeoID Value="117"/>
 </gs:LocationPreferences><gs:MUILanguagePreferences> 
 <gs:MUILanguage Value="en-US"/>
 <gs:MUIFallback Value="he-IL"/>
 </gs:MUILanguagePreferences><!-- system locale --> 
 <gs:SystemLocale Name="he-IL"/><!-- input preferences --> 
 <gs:InputPreferences>
 <gs:InputLanguageID Action="add" ID="0409:00000409"/>
 <gs:InputLanguageID Action="add" ID="040D:0002040D"/>
 </gs:InputPreferences>
 <gs:UserLocale>
 <gs:Locale Name="he-IL" SetAsCurrent="true" ResetAllSettings="false">
 </gs:Locale>
 </gs:UserLocale>
 </gs:GlobalizationServices>For detection of the application: try{ $DefaultHive = "microsoft.powershell.core\Registry::HKEY_USERS\.DEFAULT" $CP = Join-Path -Path $DefaultHive -ChildPath "Control Panel\International" $KL = Join-Path -Path $DefaultHive -ChildPath "Keyboard Layout\Preload" $DHCP = Get-ItemProperty -Path $CP $DHKL = Get-ItemProperty -Path $KL if($DHCP.Locale -eq "0000040D" ` -and $DHCP.LocaleName -eq "he-IL" ` -and $DHCP.iCountry -eq "972" ` -and $DHKL.1 -eq "00000409" ` -and $DHKL.2 -eq "0000040D"){ Write-Output "Profile international settings were copied successfully" exit 0 }else{ Write-Error "Error copying profile international settings" exit 1 } }catch{ $ErrorMessage = $_.Exception.Message Write-Error $ErrorMessage exit 1 }Rahamim 
I was able to run trials on a VM and I can't get this to work.
I created a win32 app deployed to system with the following script:
$Hebrew = Get-WindowsCapability -online -Name lang*he* | Where-Object displayname -Match "hebrew"
foreach($h in $Hebrew){if($h.State -ne "Installed"){Add-WindowsCapability -Online -Verbose -Name $h.name}}
Set-WinSystemLocale -SystemLocale he-IL
Set-Culture -CultureInfo he-IL
Set-WinHomeLocation -GeoId 117
Set-WinUserLanguageList en-US,he-IL -Force
$XMLfile = @"
<gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend">
<!-- user list -->
<gs:UserList>
<gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/>
</gs:UserList>
<!-- system locale -->
<gs:SystemLocale Name="he-IL"/>
<!-- input preferences -->
<gs:InputPreferences>
<gs:InputLanguageID Action="add" ID="0409:00000409"/>
<gs:InputLanguageID Action="add" ID="040D:0000040D"/>
<!--gs:InputLanguageID Action="remove" ID="0409:00000409"/-->
</gs:InputPreferences>
</gs:GlobalizationServices>
"@
New-Item -Path $env:TEMP -Name "intlcfg.xml" -Value $XMLfile -Force -Verbose
$XMLPath = Join-Path $env:Temp -ChildPath "intlcfg.xml"
& $env:windir\System32\control.exe "intl.cpl,,/f:`"$XMLPath`""
Start-Sleep 5
& $env:windir\System32\control.exe "intl.cpl,,/f:`"$XMLPath`""
Get-Item -Path (Join-Path $env:TEMP -ChildPath "intlcfg.xml") | Remove-Item -Verbose
If I run this manually in an OOBE fresh installation, I get the expected result. but when I try it during autopilot the settings don't copy.
Rahamim.
- RahamimLMar 31, 2022Iron ContributorRudy_Ooms_MVP thanks for your help. My xml was wrong. I ended up creating a different app with a CMD file in it and the xml inside the win32 package. I also separated the PowerShell script to add the language to a different win32 package. For anyone requiring something similar here is my xml: <gs:GlobalizationServices xmlns:gs="urn:longhornGlobalizationUnattend"> <gs:UserList> 
 <gs:User UserID="Current" CopySettingsToDefaultUserAcct="true" CopySettingsToSystemAcct="true"/>
 </gs:UserList><!-- GeoID --> 
 <gs:LocationPreferences>
 <gs:GeoID Value="117"/>
 </gs:LocationPreferences><gs:MUILanguagePreferences> 
 <gs:MUILanguage Value="en-US"/>
 <gs:MUIFallback Value="he-IL"/>
 </gs:MUILanguagePreferences><!-- system locale --> 
 <gs:SystemLocale Name="he-IL"/><!-- input preferences --> 
 <gs:InputPreferences>
 <gs:InputLanguageID Action="add" ID="0409:00000409"/>
 <gs:InputLanguageID Action="add" ID="040D:0002040D"/>
 </gs:InputPreferences>
 <gs:UserLocale>
 <gs:Locale Name="he-IL" SetAsCurrent="true" ResetAllSettings="false">
 </gs:Locale>
 </gs:UserLocale>
 </gs:GlobalizationServices>For detection of the application: try{ $DefaultHive = "microsoft.powershell.core\Registry::HKEY_USERS\.DEFAULT" $CP = Join-Path -Path $DefaultHive -ChildPath "Control Panel\International" $KL = Join-Path -Path $DefaultHive -ChildPath "Keyboard Layout\Preload" $DHCP = Get-ItemProperty -Path $CP $DHKL = Get-ItemProperty -Path $KL if($DHCP.Locale -eq "0000040D" ` -and $DHCP.LocaleName -eq "he-IL" ` -and $DHCP.iCountry -eq "972" ` -and $DHKL.1 -eq "00000409" ` -and $DHKL.2 -eq "0000040D"){ Write-Output "Profile international settings were copied successfully" exit 0 }else{ Write-Error "Error copying profile international settings" exit 1 } }catch{ $ErrorMessage = $_.Exception.Message Write-Error $ErrorMessage exit 1 }Rahamim - David BargnaOct 18, 2023Iron Contributordoes this run in system context/device? we have tried the same and it doesnt seem to apply. W11, autopilot+esp
 
- RahamimLMar 16, 2022Iron ContributorRudy_Ooms_MVP as far as I see in Intune the application is configured correctly. This is the detection script: try{ 
 $iCountry = (Get-ItemProperty 'HKCU:\Control Panel\International' -Name iCountry -ErrorAction Stop).iCountry
 $Locale = (Get-ItemProperty 'HKCU:\Control Panel\International' -Name Locale -ErrorAction Stop).Locale
 $iCurrDigits = (Get-ItemProperty 'HKCU:\Control Panel\International' -Name iCurrDigits -ErrorAction Stop).iCurrDigits
 $iCurrency = (Get-ItemProperty 'HKCU:\Control Panel\International' -Name iCurrency -ErrorAction Stop).iCurrency
 $iLZero = (Get-ItemProperty 'HKCU:\Control Panel\International' -Name iLZero -ErrorAction Stop).iLZero
 if($iCountry -eq 972 -and `
 $Locale -eq '0000040D' -and `
 $iCurrDigits -eq 2 -and `
 $iCurrency -eq 2 -and `
 $iLZero -eq 1){
 Write-Output "International configurations were set correctly"
 exit 0
 }
 }catch{
 $ErrorMessage = $_.Exception.Message
 Write-Error $ErrorMessage
 exit 1
 }If this detection script is wrong I'll be happy to know what to change. As I said, this works manually in OOBE.