Using the Task Sequence Documentor v2 with PowerShell

Like many organizations out there, we have had a need to document our ConfigMgr 2012 task sequences. There are a few ways to do this, but I prefer the Task Sequence Documentor v2.

This is a very simple tool that uses the task sequence XML and a formatting xsl file to display a HTML page in Internet Explorer. Throw a nice PowerShell wrapper around it and you have an automated documentation method!

Kudos to The Deployment Guys for putting this together, and Benjamin McConnell and Chrispy in the comments section for the PowerShell reference!

The xsl file

By default, the xsl file gives you a nice old 90’s style format.

OutputBefore

I am no web design expert, but I do like to segregate the child items with a border.

Just edit line 30 and 36 to add a little border. Add the border-color and set border=’1′.

This gives a little better output. Feel free to edit as necessary to tailor to your needs.

OutputAfter

 

The script

  • Must have the ConfigMgr 2012 Console installed
  • Must run with PowerShell x86
  • Must run with PowerShell 3.0+
  • Must have tsDocumentorv2.xsl in the script root
  • Lines to edit
    • Line 1 – $sitecode – ConfigMgr site code
    • Line 4 – $tsbackup – Path to backup to
    • Line 41 – Export-TaskSequences -filter “*TaskSequenceNameHere*”
  • Saves xml and xsl file to Backup_MMDDYYYY_HHMMSS

This script is a little rough around the edges, but it can be ran on a schedule to backup the task sequences you need.

Running it!

To view the documented task sequence you need to open the exported XML in Internet Explorer. When you open it, you will get prompted. The prompt is different for each version of IE, but on IE11 you get this.

IEPrompt

OutputFull

Enjoy!

6 thoughts on “Using the Task Sequence Documentor v2 with PowerShell

  1. Being able to document Task Sequences is a handy thing, but doing it manually is incredibly tedious, error prone, and likely to miss details.

  2. Mike Compton

    This is excellent!!

    Thanks

  3. Mike Compton

    Me again.

    It appears that the script will fail with any task sequences that have a forward slash (/) in name. I presume there are a number of characters which will do like wise:

    @ ” * ? \ / | : )

    Don’t suppose you want to amend you script to ignore those, or replace with an underscore or something?

    • Yeah that shouldn’t be too hard Mike, keep an eye out for an update

  4. George

    Hello Daniel

    Thanks a lor for your work.
    I would like to ask you, I don’t understand very well how I can send to Task Sequense my variables, is it possible send it from the same script?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">