Pausing an SCCM Task Sequence, a bit different.

That’s the first entry on my just newly created blog. Nothing fancy yet, more to come I hope.
And yes, I’m aware that there are countless postings on how to pause a task sequence.

I actually used one of those for my variation.
(Credits to the original author: http://www.windows-noob.com/forums/index.php?/topic/8846-how-can-i-pause-a-task-sequence-in-system-center-2012-configuration-manager/)

The difference is that while troubleshooting a Task Sequence, it may have quite a few breakpoints and not being able to figure out where it paused bothered me. Hence this improved version.

What does it do?

Instead of just opening a text box, saying like “pause, press ok to continue”, it displays the step name instead, informing at which point in the task sequence it stopped.
Additionally any variable available to the Task Sequence can be shown.

An example. Assume this is the Task Sequence Name;


(“! PAUSE” is added to make finding them easier in a (long) task sequence)

results in:

Requirements:

  • MDT
    It may actually work without it, but I didn’t try as I don’t see a point of not having MDT integrated with SCCM. It is so useful and base functionality is easy to learn.
  • A small VB-script.
    It’s small, I just add it here. Save this to a *.vbs file. Naturally the one you want to use for the command line, like “pause_ts.vbs”

    Set TsProgressUI = CreateObject(“Microsoft.SMS.TsProgressUI”)
    TsProgressUI.CloseProgressDialog
    for i = 0 to wscript.arguments.count – 1
        step = step & wscript.arguments(i) & ” “
    next
    MsgBox “Step: ” & step + chr(13) + chr(13) & “To resume the task sequence please click on OK.”, 64,”Task Sequence PAUSED!”
    wscript.quit(0)

  • The servceUI.exe from MDT
    located here:
    <MDT-Install-Folder>\Templates\Distribution\Tools\<CPU-Architecture>

    For (automatic) x86 and x64 support, copy them both and rename them to (saves using scripts or if’s):

    • serviceUI_AMD64.exe
    • serviceUI_x86.exe
  • Put the script and the exe(s) in a package and distribute.
    No program required.
  • The Task Sequence Step
    Provide the Name (text) you want to be displayed, e.g.
    • “! PAUSE _SMSTSMachineName=%_SMSTSMachineName%”
      Or
    • “Pausing before my fancy custom action”
      Enter the command  line:
    • serviceUI_%PROCESSOR_ARCHITECTURE%.exe process:TSProgressUI.exe %SYSTEMROOT%\System32\wscript.exe pause_ts.vbs ‘%_SMSTSCurrentActionName%’
    • Select the package you’ve created

Example:


“That’s awesome, but I want to display a zillion variables at the same time and it doesn’t fit in the name field”

While you can add all kind of variables into the step name, you’re limited by the max. length for a step name: 50 chars.
If that isn’t enough, use the command line directly or a mix, to extend:

serviceUI_%PROCESSOR_ARCHITECTURE%.exe -process:TSProgressUI.exe %SYSTEMROOT%\System32\wscript.exe pause_ts.vbs ‘%_SMSTSCurrentActionName% COMPUTERNAME=%COMPUTERNAME%’


“How can I suppress those messages without deleting them?”

The simplest method is to check against a Task Sequence Variable such as “Debug equals true”.

Either enable/disable directly in the task sequence at the beginning for all or use collection/machine variables to control them more specifically.

Feedback welcome