Monday, 28 August 2017 18:50

Create CustomSettings.ini Using PowerShell

Written by
Rate this item
(1 Vote)

image

A couple of days ago, I posted a blog post detailing how to add language packs to MDT using PowerShell. In today's blog post I am going to build up on that and showcase how I use PowerShell to automatically generate a tasksequence specific CustomSettings_%TaskSequenceID%.ini containing the rules required to create a simple and dynamic deployment process. This includes configuring commonly used rules and also injecting language pack GUIDs.

Recently a customer of mine decided to skip creation of reference images for Windows 10 installation and instead apply all image customization dynamically during OSD. This includes removal of several UWP apps, capabilities as well as application installation and language pack injection. This approach, while detrimental to the installation duration, has its charms. The modifications are (in most cases) applicable to all Windows 10 versions and this dynamic approach allows to easily service 10+ countries with a single image. 

Prerequisites:

  • Usage of a second, custom task sequence specific CustomSettings.ini file containing task sequence specific rule collection. 
  • In addition, you will need some way to automatically determine target country in CustomSettings. Typically I implement a naming convention where the first 2 characters in computer name designate the country of origin and use a switch to select correct set of language packs and features on demand. You may come up with a different approach that suits your needs better.
    Priority=ComputerNameAlias, SetLocale, Default
    Properties=OSDCountry
    
    [ComputerNameAlias]
    OSDCountry=#Left("%OSDComputerName%",2)#
    
    ; This section acts as a switch for language packs
    [SetLocale]
    Subsection=%OSDCountry%

This approach ensures that the deployment becomes much more dynamic and that leads to less hassle and more work done in less time.

  1. Download and open MDT-GenerateTSini.ps1 PowerShell script
    Note: Make sure that the following variables match your environment: $con_list, $src_xml, $w10_ver, $w10_dir, $w10_ts
    $con_lis = @("AT","BE","CH","DE","ES","GR","HU","LU","NL","PL","PT","RU","SE","TR") #lang list
    $src_xml = "\\MDT01\W10$\Control\Packages.xml" #package list
    $w10_ver = "10.0.14393.0" # W10 build number, has to match target OS build
    $w10_dir = "Windows 10 1607 Enterprise x64" #OS folder, required for .NET 3.5 sources
    $w10_ts  = "10_1607" #Task Sequence ID
  2. Run the script. The script will parse Packages.xml file specified in the $src_xml variable and select packages’ names and GUIDs matching $w10_ver value.
    The script will then proceed with the generation of CustomSettings_%TaskSequenceID%.ini file by creating the header section and will then populate the ini file by adding language packs’ GUIDs for each country specified in the $con_list variable.
    Example: For Germany you will end up with the following entries:
    [DE]
    ;Language Pack
    LanguagePack001={b490eee9-9ca1-4553-a099-91c483745461}
    ;Basic
    LanguagePack002={eb4ae15f-da18-4bce-b921-54c233bdb204}
    ;Text-to-speech
    LanguagePack003={c8b785a8-7dce-4437-aed0-eb2375fb62e7}
    ;Speech recognition
    LanguagePack004={cf5a0d00-ce4c-41bb-8c20-4077bd55556f}
    ;Optical character recognition
    LanguagePack005={10f04db8-6a88-4601-a595-66561d8590f2}
    ;handwriting recognition
    LanguagePack006={81459e02-f15e-465d-a432-b38e8aa44bc1}
    Note: Based on the created CustomSettings_%TaskSequenceID%.ini, MDT will install multiple languages onto the same Windows 10 image. For each language, where available, it will add following components:
    • Language pack and the Basic components.
    • (To preload Cortana features) Text-to-speech, and Speech recognition.
    • Fonts and Optical character recognition for the most popular languages within a region to improve end user’s first experience (strongly recommended).
      Note: If they’re not already installed, Windows downloads and installs them in the background when the user chooses that language for the first time.
    • Handwriting recognition (for devices with pen inputs.)

    Important: Not all capabilities are available for every language. Installation order matters due to various dependencies. Keep in mind that while the Windows 10 language packs are smaller, having too many can still affect disk space, and can affect performance, especially while updating and servicing Windows.
    Finally, the script adds NetFX 3.5 source path based on the information provided in the $w10_dir variable.
  3. The resulting CustomSettings_%TaskSequenceID%.ini is located in the script’s folder. You will need to copy it to the Control folder located inside your Deployment Share.

Important considerations:

  • Some languages require more hard-disk storage space than others.
  • Don’t add too many language packs at once, because the device may not have enough memory to handle it. General recommendations: from Windows PE, don't add more than 7. If WinPE is still running out of memory, you can customize WinPE by adding temporary storage (scratch space).
  • Always install language packs before installing updates.
  • The version of the language pack must match the version of Windows. The build number must also match.
Read 15591 times Last modified on Monday, 28 August 2017 20:11

Recent Posts

  • Windows 10 21H2 Built-In Apps: What to Keep
    The development of the Windows 10, version 21H2 is finished and the update will soon be available for download from…
    Written on Wednesday, 20 October 2021 11:41
  • Group Policy Changes in Windows 10 21H2
    As Windows 10, version 21H2 update development winds down, Microsoft is now preparing for the final release of the Windows…
    Written on Wednesday, 20 October 2021 07:20
  • Group Policy Changes in Windows 10 20H1 Preview
    As Windows 10 Vibranium Update (20H1) development winds down, Microsoft is now beginning the phase of checking in the final…
    Written on Tuesday, 14 January 2020 04:51
  • An alternative ESU MAK Activation Solution
    This blog post was shared with me by a colleague of mine, Daniel Dorner, a Microsoft Premier Field Engineer. It’s…
    Written on Wednesday, 04 December 2019 21:04
  • The Case of Missing UE-V Templates
    My customers often deal with unexpected Windows behavior and this case is no different. This particular one is especially interesting…
    Written on Tuesday, 03 September 2019 12:20
  • The Case of Changing Default Printer
    While I sometimes long for the day when I no longer have to deal with unexpected Windows 10 behavior, there’s…
    Written on Wednesday, 14 August 2019 20:36