MDT 2012 Update 1: Roles and Features improvements

Apparently I was so wrapped up in the MDT 2012 Update 1 development process that I forgot to talk about one of the areas that consumed weeks of my time before the MDT 2012 Update 1 release: improvements to the “Roles and Features” logic.

In MDT 2010 and MDT 2012, we had a task sequence action to “Install Roles and Features” that you could use to install roles and features on various operating systems.  But it didn’t support Windows 8 or Windows Server 2012; it tried (unsuccessfully in some cases) to merge all of the role and feature lists into one single list for the rest of the OSes; it didn’t include a complete list of roles and features for all the OSes (e.g. Windows 7); etc.  Basically, it needed a lot of work.

So in MDT 2012 Update 1, we took the opportunity to do some housecleaning.  First, we changed the “Install Roles and Features” task sequence UI to allow you to display a filtered list of roles and features for the particular OS you are deploying:


We also made sure that the complete lists were present for all the various OSes:  Windows 7, Windows 8, Windows Server 2008 (full install and core install), Windows Server 2008 R2 (full install and core install), and Windows Server 2012 (full install and core install).  (We didn’t change the list for Windows XP and Windows Server 2003.  Given that those are already in extended support and rapidly approaching their end-of-life date, we’re not adding new functionality for them.)  And we verified the lists – something that gave our test team a real workout, as we had to make sure that we properly handled all the dependencies between the roles and features on OSes where that wasn’t handled automatically (e.g. Windows 7).

Then, we added a new Lite Touch wizard pane to let you dynamically choose roles and features.  It automatically displays the right list based on the OS being deployed, allowing you to choose additional roles and features to install later in the task sequence:


What do you need to enable this wizard pane?  Just add a step to the task sequence (somewhere in the State Restore phase; the exact location doesn’t matter, but I typically choose to put it in the “Custom Tasks” group) and the new pane will automatically show up.  If you don’t want the wizard pane, you can turn it off through Custom Settings.ini by specifying “SkipRoles=YES”.

We also added a new “Uninstall Roles and Features” task sequence step that can be used to remove roles and features that you no longer want.  It presents exactly the same list of roles and features inside the task sequence editor:


Notice the red box above, which I highlighted to point out one specific Windows 8 and Windows Server 2012 feature (and only shows up when you choose Windows 8 or Windows Server 2012):  Not only can you uninstall roles and features, but you can also completely remove the components, getting rid of all the files related to that component.  (If you ever want to add those back, Windows can download the components from Windows Update, or you can provide the original media to pull them from the WIM file.  See for more details around this, as well as for information about how to specify an alternate “repair source” instead of Windows Update.)

It’s worth noting too that we added some extra logic to handle the installation of .NET 3.5 on Windows 8 and Windows Server 2012.  For both of these OSes, the .NET 3.5 feature is not present in the standard WIM file, but the files do exist on the media in the \sources\sxs folder.  So for Lite Touch deployments, we will automatically provide these files to Windows as long as you have imported the full source files into your deployment share.  For ConfigMgr clients, you would need to do a little bit more:

  • Set up a network share containing the contents of the “sources\sxs” folder from the original Windows 8 or Windows Server 2012 media.
  • Set a task sequence variable (either through CustomSettings.ini or directly in the task sequence) called “WindowsSource” that points to the location of that folder.

Behind the scenes, the script responsible for performing the role and feature work, ZTIOSRole.wsf, figures out the right thing to do for each OS:

  • For Windows Server 2003, use SYSOCMGR.EXE.
  • For Windows Server 2008, use SERVERMANAGERCMD.EXE.
  • For Windows 7 or Windows 8, use DISM.EXE.
  • For Windows Server 2008 R2 (non-core) or Windows Server 2012, use PowerShell.
  • For Windows Server 2008 R2 (core), use OCSETUP.EXE.

Fun stuff.  (For those of you keeping track, this also means that MDT now actually uses PowerShell itself during a deployment task sequence to install or uninstall roles and features on Windows Server 2008 R2 and Windows Server 2012.  To keep things simple, the ZTIOSRole.wsf script calls the ZTIOSRolePS.ps1 script to take care of this.  Look at the logic in ZTIOSRole.wsf and the new ZTIPSUtility.vbs script to see how that works, in case you ever have the need to do something similar, e.g. do some work in VBScript and some in PowerShell.)

Comments (17)
  1. Yes, this is a breaking change – you would need to reconfigure any existing "Install Roles and Features" steps.

  2. There's no simple way, although you could probably build a custom UDI wizard pane with a small list of roles to choose from (e.g. checkboxes).

  3. Anonymous says:

    For obvious reason, due to this "awesome" change, I found that any previously created "Install Roles and Features" tasks within your existing task sequences won't work on MDT 2012 U1 until you manually specify OS and give a Condition… Thanks,

  4. There are no definitive plans for the next release, so it's hard to say at this point.

  5. Brian Klish says:

    Same problem as Anon above me. Are we expected to check the box in the Deployment Wizard and also in the task sequence? I found that by just checking .Net 3.5 in the task sequence it fails to install it and says “path not found” in BDD.log. I have the full set of source files imported for the operating system.

  6. Anonymous says:

    I really like the use of powershell here.

  7. Brian Klish says:

    It seems to fail with “path not found” even if I pick it in Deployment Wizard and Task Sequence.

  8. Anonymous says:

    Another good staff implemented into MDT.

  9. stephen says:

    Those are really excellent changes.  thanks heaps to the MDT team for thinking those cases through.  supporting the uninstalled payload removed capability of win8/server2012 is fantastic

  10. Graeme says:

    Michael, this was a great change.  I had many roles and features installs that were failing because of the oddness with the first revision.

    I did break everything though when I did the upgrade (without noticing)!  Oops

  11. Matt says:

    When you say:

    •Set up a network share containing the contents of the “sourcessxs” folder from the original Windows 8 or Windows Server 2012 media.

    •Set a task sequence variable (either through CustomSettings.ini or directly in the task sequence) called “WindowsSource” that points to the location of that folder.

    What do you mean in the second bullet by "location of that folder"?  Do you mean the folder that house the complete install bits for Srv2012 or just the sourcessxs folder?  I ask because I have setup a share, variable, and pointed it to the sxs folder, but I keep getting a "ZTIOSRole – unhandled error – permission denied" error when I get to the .NET install step in my TS.  

    Also, I'm not using MDT, I'm using SCCM with an MDT step, I set my variable first, then call the MDT Toolkit package, followed by a Gather, followed by .NET install via Install Roles and Features step.

    Thanks for any help!

  12. Matt says:

    Is it possible to get a Roles and Features pane using UDI or another method when deploying images using sccm2012?

  13. Matt says:

    In the a feature release is this pane going to be available in SCCM2012 using MDT?

  14. Bendo says:


    Great work,

    How to configure the roles and features once installed? As in SMTP or IIS6 config? Is this possible with MDT?


  15. Anon says:

    I followed this. I added a task sequence for Windows 8.1. I selected .NET 3.5. However when the litetouch install runs, .net 3.5 is not selected. I opened the ts.xml and confirmed it's in there. Anyone else having this problem? I think this person is also seeing the same:…/mdt-2013-who-knows-the-value-name-for-net-framework-feature-in-the-osfeatures-property

  16. Anon says:

    If I do SkipRoles=YES .Net 3.5 does install. So how do you make it preselected in the Wizard also? Put something in CustomSettings.ini?

  17. Phil Wood says:

    I’m trying to get this working in SCCM 1602 with MDT 2013 Update 2 integrated for a Windows 10 TS. Looks like the share is ok, but I’m getting the following in the logs:

    Microsoft Deployment Toolkit version: 6.3.8298.1000 ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    The task sequencer log is located at C:\WINDOWS\CCM\Logs\SMSTSLog\SMSTS.LOG. For task sequence failures, please consult this log. ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    Roles will be installed. ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    No items were specified in variable OSRoles. ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    No items were specified in variable OSRoleServices. ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    Features specified in Feature: ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    NetFx3 ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    No items were specified in variable OptionalOSRoles. ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    No items were specified in variable OptionalOSRoleServices. ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    No items were specified in variable OptionalOSFeatures. ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    ZTI Heartbeat: Processing roles (0% complete ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    Validating connection to \\SCCMTRIALPS1\WindowsSource ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    Mapping server share: \\SCCMTRIALPS1\WindowsSource ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    Property UserDomain is now = DSG ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    Property UserID is now = SVC_NetworkAccess ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    ZTIOSRole 24/06/2016 20:21:45 0 (0x0000)
    Mapped Network UNC Path Z: = \\SCCMTRIALPS1\WindowsSource ZTIOSRole 24/06/2016 20:21:46 0 (0x0000)
    Found Existing UNC Path Z: = \\SCCMTRIALPS1\WindowsSource ZTIOSRole 24/06/2016 20:21:46 0 (0x0000)
    Successfully established connection using supplied credentials. ZTIOSRole 24/06/2016 20:21:46 0 (0x0000)
    Copying source files locally from \\SCCMTRIALPS1\WindowsSource ZTIOSRole 24/06/2016 20:21:46 0 (0x0000)
    ZTI ERROR – Unhandled error returned by ZTIOSRole: Invalid procedure call or argument (5) ZTIOSRole 24/06/2016 20:21:46 0 (0x0000)
    Looks like it is connecting to the share ok, but getting an error when trying to copy the files locally. I’ve tried several different configurations for the share (sxs folder or just the files in the share root) but get the same error every time.
    Looking through the logic in the scripts, it definitely appears to fail when copying the files locally – not sure what else to try.

Comments are closed.

Skip to main content