Customising the MDT Task Sequence Editor

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 .