Home » MDT (Microsoft Deployment Toolkit) – Task Sequences and CustomSettings.ini

MDT (Microsoft Deployment Toolkit) – Task Sequences and CustomSettings.ini

MDT is a technology designed to allow greater control and flexibility when deploying Microsoft operating systems. It relies on WDS (Windows Deployment Services) for some of its operation, however – much like SCCM (System Center Configuration Manager), it allows the use of tasks to perform additional steps during the capture or deployment process.

Think of it as a “poor man’s SCCM”, but that isn’t to say it isn’t useful and isn’t good at what it does, provided you can take the time to learn it and play with it in various ways to discover what it can do.

One of the more interesting features is to have certain settings apply based on the Task Sequence ID selected, either at boot-time or via the LiteTouch.vbs script.

This is meant to work flawlessly out-of-the-box but numerous hours of head-scratching and research revealed this isn’t quite the case.

Consider the following scenario:

2 Task Sequences (IDs – CAPTURE-W7 and INSTALL-W7)
One of them captures a pre-built workstation (in this case, Windows 7) using the ‘Sysprep And Capture’ task sequence.
The other performs the installation, using the ‘Standard Client Task Sequence’.

You have a ‘customsettings.ini’ that looks something like this:

What should happen is that when you select your task sequence, is that it loads the settings for that task sequence prior to execution. In this case, you wouldn’t want a CAPTURE task to join the domain, you’d also want to be certain it actually DOES the capture. Whereas with an INSTALL task, you’d potentially want it to join the domain, but not attempt to capture the system.

So if we selected ‘CAPTURE-W7’ it would load our settings for the task sequence first and then the default settings. However, when you select the task (at boot or with LiteTouch.vbs), it does not reload the customsettings.ini, instead, it applies only the default settings.

The way to get around this issue is to modify the tasks in question, to modify the DeployWiz_SelectTS.vbs script in your Deployment Share\Scripts folder and lastly, modify your customsettings.ini file.

NOTE: The file modifications to DeployWiz_SelectTS.vbs are designed to be done on the MDT 2012 SP1 file – version 6.1.2373.0. Whilst you can put these changes into another version of the file, your results may vary – as always, back up your file BEFORE you change it.

 

Firstly – changing the file:
After backing up the DeployWiz_SelectTS.vbs file, do a search for the ‘ValidateTSList’ function, it is in this function the following modifications will be required.

At around line 90 of the file, you should have this:

Change it to the following:

At around line 157 of the file, you should have this:

Change it to the following and save:

What this does is that it re-runs ZTIGather.wsf, which forces it to look over your customsettings.ini again and load in the task sequence.

Modifying the Tasks:

Right click the task you wish to change and click Properties.
Click the ‘Task Sequence’ tab.
If the task you are modifying is a ‘Standard Client Task’, you must modify the ‘Gather Local Only’ action, which resides within the ‘Initialization’ section.
Change the action from ‘Gather Only Local Data’ to ‘Gather Local Data And Process Rules’.
In the text-box immediately below that setting, enter the following:

Apply the setting and click OK.

If the task you are modifying is a ‘Sysprep and Capture Task’, you need to click ‘Add’, then ‘General’, then ‘Gather’. Move this new action to the top of the tree so it is above the ‘Capture’ section.

Change the action from ‘Gather Only Local Data’ to ‘Gather Local Data And Process Rules’.
In the text-box immediately below that setting, enter the following:

Apply the setting and click OK.

All of this ensures your tasks now use your customsettings.ini file, which is where your task sequence rules exist.

Lastly, modifying customsettings.ini:

Using the following for an example:

Change it to the following:

What this does is it ONLY looks at your rules for task sequence IDs, instead of then looking at default. However it no longer processes the default rules at all, which is why we have the additional ‘Subsection=Default’ lines. It tells MDT to process ‘Default’ as part of the rule-set.

Whilst this does work (and works well in our production MDT environment), you still need to be careful with what settings you apply and where you apply them.

For Example:

If you were to use the ‘INSTALL-W7’ task, it would set the _SMSTSPackageName variable to what you originally wanted, but it would then set it again to what ‘Default’ has. It’s a case of last-set wins.

I did not come up with this solution myself, it was cobbled together from various sources and simply put together in this blog page so others can find it.

Contact Me
* indicates required field