Feb 15 2022 02:38 AM - edited Feb 15 2022 02:39 AM
Hi everyone,
I'm trying to achieve the following for new computers in autopilot:
In MECM this is the Apply windows settings which looks like this:
The end result I'm looking for is this:
I searched the web and also found the Copy-UserInternationalSettingsToSystem, but this is for windows 11... We are still deploying windows 10.
I found and tested multiple options such as deploying the LXP and using several powershell commands to apply what I need but it doesn't exactly work.
This is my autopilot profile:
Is there a way to use some unattended file or any other way to configure the operating system to our international settings?
Rahamim.
Feb 15 2022 05:06 AM - edited Feb 15 2022 05:07 AM
Hi
Normally I would say to create a powershell script with the additional language cab in it. And configure all settings you want in that powershell script. as example
DISM /Online /Add-Package /PackagePath: .\lp.cab
Set-WinUILanguageOverride <xx-xx> (where xx-xx is your language culture)
And convert it to a win32 app and deploy it as an required app during autopilot esp?
Could you show us what you have tried until know?
Feb 17 2022 02:12 AM
Feb 17 2022 02:15 AM
Feb 17 2022 04:08 AM
Mar 16 2022 07:32 AM
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.
Mar 16 2022 07:45 AM
Mar 16 2022 08:07 AM
@Rudy_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.
Mar 31 2022 12:21 AM
Solution@Rudy_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
Oct 18 2023 11:16 AM
Mar 31 2022 12:21 AM
Solution@Rudy_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