Earlier this week I got a question on how to have a single MDT Lite Touch task sequence support a dynamic selection of OS Image.
Now, typically I recommend having a 1:1 relationship between task sequence and OS Image, but you can certainly have MDT dynamically pick an OS Image based on a variable you define in CustomSettings.ini. It just requires a little trick 🙂
Scenario
In this scenario I'm setting a custom variable named CustomImageVariable to dynamically select an OS Image.
This means I have multiple Install Operating System actions in my task sequence, each of them with a condition. For example CustomImageVariable=1607 (see below).
An Install Operating System action configured with a condition.
The tricks
If you only do the above configuration, MDT will select the first OS Image that is configured with the task sequence. This is done even before the Install Operating System is run, so to force MDT use the image you want, you need to clear the OSGUID variable before the various Install Operating System actions. Here is how:
Adding a Set Task Sequence Variable action to clear the OSGUID variable.
CustomSettings.ini
Finally you need to have your CustomSettings.ini file dynamically set the CustomImageVariable variable. Here is an example with CustomSettings.ini being configured to set it differently depending on default gateway (network).
[Settings]
Priority=DefaultGateWay, Default
Properties=CustomImageVariable
[DefaultGateWay]
192.168.10.1=Oslo
192.168.20.1=Stockholm
[Oslo]
CustomImageVariable=1607
[Stockholm]
CustomImageVariable=1703
[Default]
OSInstall=YES
Written by Johan Arwidmark
Hi, Can I use Dynamic OS Image based Total Control
If you refer to selecting different drivers, that can be implemented with conditions too. However, for most environments, I recommend having a 1:1 relationship between the task sequence and the OS Image. Makes driver management easier too.
Wonderful Article. Thanks. to stray a little bit, I'd like to be able to have the user prompted at run-time. Issue, I need to make these into deployable media. It seems there HAS to be a way to add a wizard pane with a set of radio buttons or dropdown list. Currently the media has a limited set of Task Sequences to choose from, but I need to be able to support the same set of TSes on top of multiple versions of windows, depending on the … uh "department". All the different 'departments' are 'silos' that use exactly the… Read more »
Hi Dan,
You can absolutely create custom wizard panes in MDT Lite Touch to do pretty much anything, even for the standalone media. It's not very straightforward, but doable. I've done some in the past. Damien Van Robaeys has a few guides on his blog, for example this one: https://www.systanddeploy.com/2016/08/create-your-own-mdt-wizard.html
Hello Johan.. I've just come into this article of yours, and I would like to think that its what I need, or somewhere close to it. Basically when I run my TS, I need the user to indicate the PC Name, and then choose a TS to deploy (could be vice versa). I have several TS that has different applications depending on the location of where the laptop will be used in.
Hi, I want use task sequence id and get osdcomputername for sequence id that but error. You can help me customsetting.ini?
I don't quite follow, do you want to set the computer name based on the Task Sequence ID selected?
Hi Johan. Would this solution work with an MDT Integrated SCCM Task Sequence? I know it is an older blog post but seems to fit my situation. Essentially, I am trying to reduce down the number of Win10 task sequences we have in our environment. I have a PowerShell GUI tool launched at the beginning of our MDT integrated task sequences so that our techs can set a few variables based on certain criteria they select (e.g. what apps to install). In the GUI I am looking to add the selection of what Custom Image the tech needs to deploy… Read more »
I would recommend reducing the number of images instead, but for SCCM you can use multiple Apply OS Image actions in the same task sequence and set conditions on them.
Ehh, sorry just wanted to quickly chime in that my Windows 7 OS had its autoattend xml missing. more specifically, the new autoattend i generated for it was basically blank and didn't have much instruction for it to use so essentially if the autoattend xml is faulty, the error i described will appear for anyone searching for an answer.
Hey one more thing, I had an issue where the windows 7 deployment could not proceed due to the task sequence's autoattend.xml being linked to Windows 10. How do we dynamically link an autoattend.xml for Windows 7 or other variants of Windows as well? Thanks in advance!
Since unattend.xml files in MDT is per task sequence, I don't recommend mixing Windows 7 and Windows 10 operating system images in the same task sequence. / Johan
Hey, me again. Yeah, posted a bit too soon yesterday… Any advice on how to merge the two? I was trying to have 1 single custom UDI interface for lite touch deployment. Any way to say, when user selects dropdown as 'windows 7' to load the older windows 7 task sequence instead? We're going to be phasing it out soon anyways, just sort of bugs me that I can't streamline now in the event a win7 installation is needed. Any advice? Any way to set a variable that specifies with unattend.xml file to use and override the one associated with… Read more »
With some creative scripting you can generate different unattend.xml files on the fly, but it's easier to just keep them in separate task sequences. / Johan
THANK YOU!!!