Forum Discussion

RahamimL's avatar
RahamimL
Iron Contributor
Feb 15, 2022

Intune auto pilot international settings

Hi everyone, I'm trying to achieve the following for new computers in autopilot: Set time zone to my time zone Set system locale, culture and windows home location to my country Set a language l...
  • RahamimL's avatar
    RahamimL
    Mar 31, 2022

    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

Resources