Monday, 28 August 2017 18:50

Create CustomSettings.ini Using PowerShell

Written by
Rate this item
(1 Vote)


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. 


  • 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
    ; This section acts as a switch for language packs

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:
    ;Language Pack
    ;Speech recognition
    ;Optical character recognition
    ;handwriting recognition
    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 2070 times Last modified on Monday, 28 August 2017 20:11

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.

Recent Posts

  • Automating Multi-node Tableau Server Environment
    After a few weeks off, I am delighted to announce that I have returned full time, once again delivering somewhat…
    Written on Monday, 19 February 2018 11:01
  • The Case of Missing TPM P@ssword
    As my regular blog readers will be aware (yes, all three of you), there is something increasingly traditional about me…
    Written on Thursday, 25 January 2018 10:04
  • The Case of "Just a Moment..."
    A key part of any complete end-to-end deployment project is analysis of the resulting logs to identify root causes for…
    Written on Tuesday, 16 January 2018 12:57
  • How to Automate Input Preferences during OSD
    A few days ago I stumbled upon a question on the Microsoft Deployment Toolkit (MDT) forum where a user asked…
    Written on Monday, 15 January 2018 12:36
  • Disabling Cortana Voice Support during OOBE
    Yesterday I came across a Twitter thread in which multiple users detailed their beef with the revamped setup experience of…
    Written on Tuesday, 12 December 2017 10:04
  • Fixing "Windows update reboot is pending" during OSD
    Automated OS deployment became common as IT professionals install systems using tools like Microsoft Deployment Toolkit or System Center Configuration…
    Written on Tuesday, 28 November 2017 08:44