none
Is it possible to run a task sequence within another task sequence RRS feed

  • Question

  • Hi all,

    Quite new to MDT, but already I'm seen a need to re-create task steps in multiple places. Is there a way to run a predefined task sequence within a task sequence?

    Chris


    Chris

    Tuesday, August 11, 2015 9:55 AM

All replies

  • You could put the actions you want to be repeatable within groups and then set a condition on those groups to a variable. Then you could apply a value to that variable in whatever way you chose. MDT Wizard pane, based on machine name etc, whatever suits.

    To give an example that may be easier to follow if you're new to MDT, open up a default task sequence and click on the "State Capture" group and then click the options tab, and you will see that it only runs if the variable named PASE is equal to STATECAPTURE.

    I'm suggesting you do something similar but with your own groups and variables.

    Perhaps STAGE = 1, STAGE = 2 etc. Then when you re-run the sequence multiple times each group of actions will only run if stage is set to the value that you want. If that sounds OK then give some thought as to what would work best for you by way of assigning values to the STAGE variable and if you have any questions on the specifics then ask.

    Cheers

    Andrew

    Tuesday, August 11, 2015 10:21 AM
  • I should also add that the simple answer to your specific question regarding running a sequence within a sequence is "nope", sorry!
    Tuesday, August 11, 2015 10:52 AM
  • Thanks for the actual answer, and a potential workaround. I will give this a go, but this screams of a feature request....

    I love the idea of Applciation Bundles, and even Bundels of Bundels, which seems to work really well. It would also seem to be Appropriate for Tasks.


    Chris

    Tuesday, August 11, 2015 11:51 AM
  • There's no reason why an application bundle needs to install an application. Remember that the crux of it is that it runs a command line, MDT won't care what that command line is. If it's msiexec /i app.msi /qb or if it's a netsh command they can all be run from applications/application bundles if that's the answer to your solution.
    Tuesday, August 11, 2015 12:24 PM
  • Hi all,

    Quite new to MDT, but already I'm seen a need to re-create task steps in multiple places. Is there a way to run a predefined task sequence within a task sequence?

    Chris


    Chris


    As already stated the answer is no, but what exactly are you trying to accomplish? You can have many tasks within a sequence, but we can help you better if you let us know what you're trying to do.

    If this post is helpful please vote it as Helpful or click Mark for answer.

    Tuesday, August 11, 2015 1:59 PM
  • Yes, an example of what you are trying to do would be helpful.
    Tuesday, August 11, 2015 3:01 PM
  • Sure.

    So, I like the fact that I can create an Application Bundle but also like the fact that Skip Applications during OS install to automate as much as possible.

    So, I created a couple of steps in my OS task sequences that install Single applications, which are the various application bundles. However, I also have need for a task that just installs various application bundles, and make some config changes on OS that have already been deployed (such as registry edits or additional roles), so re-created these Task sequences in the new Tasks.

    So, I have these same configuration changes or install steps in that I have in multiple places so thought "wouldn't it be nice if I could create a set of re-usable steps within each task so I don't have to keep recreating the same task sequence in different tasks”.

    Let’s say there are three task:

    1. Install Bundle 1
    2. Install Bundel 2
    3. Install both 1 and 2

    But each needs to have additional similar configure changes as well, such as roles or registry entries. I would like to “re-use” task steps.

    I like the idea of using application bundles to make configuration changes, and I can see how I would use that.

    I’m probably using MDT in a not designed fashion, but there is no SCCM or GPO either, and for the most part, MDT does a very good job.


    Chris

    Tuesday, August 11, 2015 3:13 PM
  • Since MDT doesn't work on magic or mind reading you do have to configure tasks in different ways to automate your deployments. Sometimes it isn't worth the work other times it's easy to do.

    In your example of application bundles, if for instance you wanted certain models to have bundle 1 and 2 you could make a bundle 3 which included all those apps. Then in your task sequence create a task to install bundle 3, but in the options tab you create a condition and WMI query.

    If any conditions are true
    ...SELECT * FROM Win32_ComputerSystem WHERE Model LIKE "%Optiplex%"
    ...SELECT * FROM Win32_ComputerSystem WHERE Model LIKE "%Latitude%"
    

    OR

    If you wanted to apply bundle 1 and 2 to desktops in customsettings you could do this

    [ByLaptopType]
    Subsection=Laptop-%IsDesktop%
    
    [Desktop-True]
    MandatoryApplications001={1D7DF331-47B7-472C-87B3-442597EC2F7D}
    MandatoryApplications002={9d2b8999-5e4d-4f3d-bb05-edaaf4fe5628}

    The GUIDs would be that of the bundles. There are many different ways to accomplish lots of things and you can use VBscripts or powershell as well. You can import apps that are x86 or x64 and restrict each app to that architecture.

    Example:

    Then you can add all of them to your bundle and MDT will install the right app for the OS architecture you are deploying.


    If this post is helpful please vote it as Helpful or click Mark for answer.

    Tuesday, August 11, 2015 4:13 PM
  • You can't run a TS inside of a TS (they rely on C:\MININT path and you'd get alot of colliding on what step the TS is on). 

    You could create a standard task sequence for deployment and then a configuration task sequence with the Post OS Apply sequence.  That sequence can be configured to install apps, restore user data with USMT, lock/unlock drive.  Here's a good article on it - https://scriptimus.wordpress.com/2012/09/13/ltizti-deployments-post-os-task-sequence/ .

    You can configure as many of those as you would like, they would run under the same MDT TS menu.  I use the Post OS Apply sequences for user applications like Chrome that don't exist on every system, and for handling data migration when we're migrating from machine A to machine B.  Hope this helps.

    Ryan


    • Edited by MrBrooks Tuesday, August 11, 2015 7:37 PM
    Tuesday, August 11, 2015 7:36 PM
  • You could create a standard task sequence for deployment and then a configuration task sequence with the Post OS Apply sequence.  That sequence can be configured to install apps, restore user data with USMT, lock/unlock drive.  Here's a good article on it - https://scriptimus.wordpress.com/2012/09/13/ltizti-deployments-post-os-task-sequence/

    You can configure as many of those as you would like, they would run under the same MDT TS menu.  I use the Post OS Apply sequences for user applications like Chrome that don't exist on every system, and for handling data migration when we're migrating from machine A to machine B.  Hope this helps.

    Ryan


    Thank Ryan (and Dan above),

    This is effectively what I'm doing. The additional Tasks are separate or over an above a Deployment Tasks, but of course within them I will reuse similar task sequence steps. I will read the link you provide to see if I can pick up anything useful from that.

    Don't get me wrong, MDT is very flexible and usable and I am only scratching the surface. Certainly, what I want to provide to the end user in terms of option and selections I would like to be limited to just the Tasks, but in building the tasks that make use of the same sequence steps (line for line or group for group) it would seem useful to be able to create a re-usable library of those steps.

    Many thanks for your pointers. I will read on.


    Chris


    • Edited by Swinster Wednesday, August 12, 2015 8:46 AM XML taes being added
    Wednesday, August 12, 2015 8:43 AM
  • If you want to build a sequence for end users to use, then look into the UDI wizard designer. It's a part of MDT called User-Driven Interface and is meant to give users a more simplistic interface, whereas the MDT wizard is for techs. However, you need SCCM. Before you get into that though, make sure you've worked out your scripts and deployment process.

    Just FYI It's easy to build many task sequences that include many of the same steps, as you can open two task sequences at once, right click on a task or group and copy, then paste it into the other task sequence.


    If this post is helpful please vote it as Helpful or click Mark for answer.

    Wednesday, August 12, 2015 1:29 PM
  • I'm still not quite sure what you're looking for. The applications are a library of re-usable steps.

    If I create an "application" called "Update MyKey", and give it a command line of

    ' reg add HKLM\Software\MyKey /v MyValue /d "my data" '

    I can use that application as many times as I like, in as many Task Sequences as I like. I can put it in six different bundles or groups, and it will run in each one of them, assuming it or its parent bundle or group meet whatever conditions you've set.

    You can use built in task sequence variable, or assign your own, and run commands using them.

    Pulling something out of my hat here, the syntax may not be correct:

    ' reg add HKLM\Software\MyKey /v MyValue /d "%MODEL% " '

    would assign the model of the PC that the task is running on to the reg key, be it "Optiplex 790" or whatever.

    The task sequences are almost *too* flexible. there are a dozen different ways to accomplish anything you need to. Deciding on the right one has always been my problem.

    Wednesday, August 12, 2015 2:28 PM
  • I'm still not quite sure what you're looking for. The applications are a library of re-usable steps.

    Indeed, I think these will do for my need. There are steps in the Tasks are simpler to configure (such as install a role or feature on a specific platform), but of course these can be accomplished through powershell - I can just never remember what the command is so need to look it up.

    I'm sure everything I need to be able to accomplish will be relativity simply once I've got used to the idiosyncrasies.


    Chris


    • Edited by Swinster Wednesday, August 12, 2015 2:49 PM
    Wednesday, August 12, 2015 2:48 PM
  • An MDT Task sequence is just a framework to hang various tasks on. The default configuration has a certain flow to it to handle the common scenarios of new computer vs refresh, BIOS vs UEFI, etcetera, but within that, you can add, duplicate or remove things to fit what you need. 

    Anything can be grouped together and/or configured to fire based on the criteria available under Options. I don't do a lot of per-model config because I'm %95 a Dell shop, but I do some. I have certain software that only installs on Dells, other things that only install on laptops.

    There is a Roles and Features task, while I don't use it, you could copy it to different folders, and configure each instance to install different things based on whether something is a laptop, desktop, or a specific model. You can be as specific as a particular serial number if you wanted to. Dozens of variables are set and available to use as conditions when the initial gathering step is done. You can re-assign some of those variables on the fly based on different conditions.

    You can group conditions, so a task will run if any condition is true, or only if all conditions are true. You can set  conditions on the applications themselves so they only run on certain OS's. You can write your own wrapper scripts around the app executables, so running install.vbs would call either the x86 or x64 install based on the script logic.

    I'd find it hard to come up with something the tool couldn't do. 

    Wednesday, August 12, 2015 4:13 PM