The Deployment Guys

Helping to deploy your world automagically...

Customising the MDT Task Sequence Editor

Customising the MDT Task Sequence Editor

  • Comments 8
  • Likes

One of the things I like the most about MDT is the level that it can be customised; you can edit the HTA screens, the provided scripts or even use existing ones to build you own.  This level of flexibility allows you to achieve pretty much anything in a deployment, once you have worked out how to do it!

I stumbled across this tip a few months ago with a colleague (thanks, Gilberto) when we were complaining about having to add the same tasks all the time to a task sequence.  A repetitive task that I wished I could automate; well, it turns out I could :-)

What I am going to explain here is how to add your own custom actions to the task sequence editor, so that you can extend it with your own actions.  If you look at the below screenshot you can see a new Deployment Guys menu item, that includes some new tasks.  Clicking on one of these tasks adds it to the task sequence in the same way that any of the other tasks can be added.

This is a great way to extend your MDT Task Sequence editor by adding all of the common tasks you manually have to add by hand.  In order to add them, you need to get your hands dirty by editing an XML file.  Before explaining it though, I'd like to remind you to back up any files you modify and that this is an unsupported modification that I am describing here.  I have had no problems with it, but if it formats your hard drive and burns your house down please don't ask for compensation...

Follow the below simple steps to add in your own custom tasks.  These steps need to be followed for each new task you wish to add.

  1. Close the MDT Workbench if you have it open
  2. Open the file Actions.xml that you'll find in the following location %PROGRAMFILES%\Microsoft Deployment Toolkit\Bin
  3. Scroll to the very bottom, and paste the following text into the penultimate line, editing the parts I have highlighted in red:

 <action>
  <Category>Deployment Guys</Category>
  <Name>Pause Task Sequence</Name>
  <Type>SMS_TaskSequence_RunCustomSuspendCommandLineAction</Type>       -  this string must be unique for every new task
  <Assembly>Microsoft.BDD.Actions</Assembly>
  <Class>Microsoft.BDD.Actions.ActionRunCommandLine</Class>
  <Property type="string" name="CommandLine" default="cscript.exe %SCRIPTROOT%\LTISuspend.wsf" />
  <Property type="string" name="WorkingDirectory" />
  <Property type="string" name="SuccessCodes" default="0 3010" />
  <Property type="string" name="PackageID" />
  <Property type="string" name="RunAsUser" default="false" />
  <Property type="string" name="SMSTSRunCommandLineUserName" />
  <Property type="string" name="SMSTSRunCommandLineUserPassword" />
  <Property type="boolean" name="LoadProfile" default="false" />
  <Property type="string" name="SupportedEnvironment" default="WinPEandFullOS" />
 </action>

 

Here is an example of the XML required to add two new actions.  Note that the first line is optional but is responsible for the dividing line between the groups in the list:

 <action divider="true" />
 <action>
  <Category>Deployment Guys</Category>
  <Name>Pause Task Sequence</Name>
  <Type>SMS_TaskSequence_RunCustomSuspendCommandLineAction</Type>
  <Assembly>Microsoft.BDD.Actions</Assembly>
  <Class>Microsoft.BDD.Actions.ActionRunCommandLine</Class>
  <Property type="string" name="CommandLine" default="cscript.exe %SCRIPTROOT%\LTISuspend.wsf" />
  <Property type="string" name="WorkingDirectory" />
  <Property type="string" name="SuccessCodes" default="0 3010" />
  <Property type="string" name="PackageID" />
  <Property type="string" name="RunAsUser" default="false" />
  <Property type="string" name="SMSTSRunCommandLineUserName" />
  <Property type="string" name="SMSTSRunCommandLineUserPassword" />
  <Property type="boolean" name="LoadProfile" default="false" />
  <Property type="string" name="SupportedEnvironment" default="WinPEandFullOS" />
 </action>
 <action>
  <Category>Deployment Guys</Category>
  <Name>Force Update of Group Policy</Name>
  <Type>SMS_TaskSequence_RunCustomGPUpdateCommandLineAction</Type>
  <Assembly>Microsoft.BDD.Actions</Assembly>
  <Class>Microsoft.BDD.Actions.ActionRunCommandLine</Class>
  <Property type="string" name="CommandLine" default="gpupdate.exe /force" />
  <Property type="string" name="WorkingDirectory" />
  <Property type="string" name="SuccessCodes" default="0 3010" />
  <Property type="string" name="PackageID" />
  <Property type="string" name="RunAsUser" default="false" />
  <Property type="string" name="SMSTSRunCommandLineUserName" />
  <Property type="string" name="SMSTSRunCommandLineUserPassword" />
  <Property type="boolean" name="LoadProfile" default="false" />
  <Property type="string" name="SupportedEnvironment" default="WinPEandFullOS" />
 </action> 

 Finally, here is a screenshot of how the modified XML file looks:

If you have any good suggestions for common tasks, please post the XML on this post as a comment for others to use!  I have to confess that I have had this blog post half written for a few months, but an internal question on a distribution list gave me the gumption to finally get it finished and published.

 

This post was contributed by Daniel Oxley, a Consultant with Microsoft Services Spain

 

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use.

  • Les deployment Guys viennent de publier un petit tips très sympathique permettant de personnaliser l

  • Daniel,

    Thank you for posting this!  I have found it very useful for automating some custom tasks.  Do you by chance know where I can find documentation and/or examples for other types of tasks and how to format them?  For instance I want to automate adding in a task that has a conditional option (ex. If TS variable isLaptop equals True).  I looked at the other tasks in the actions.xml and it does not have any examples I can follow.

  • Great article over on The Deployment Guys Blog that talks about customizing the MDT Task Sequence Editor

  • Les deployment Guys viennent de publier un billet sur comment personnaliser l’éditeur de

  • @jmascote - there is no documentation or other examples of tasks to include for this I am afraid; this was only discovered by me playing around with the files to see what they contained.  :-S  But if you discover any, please post them here!

  • Step 4.1 The Task Sequence magic Now that the Task Sequences are created, its important to note you are

  • Step 4.1 The Task Sequence magic Now that the Task Sequences are created, its important to note you are

  • Hi

    Does it work for SCCM 2007 SP2 and MDT 2010 SP1 or only for SCCM 2012 with associate MDT  ?

    I tryed with SCCM2007 and MDT 2010 and nothing change in the view (maybe I need to unregister an re-register MDT to SCCM console ??)

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment