anyweb Posted August 14, 2013 Report post Posted August 14, 2013 IntroductionSometimes things don't go as planned, you are deploying an operating system to a computer and the task sequence fails. You can use normal troubleshooting methods such as press F8 and review the smsts.log in CMTrace review a report of the task sequence progress review other OSD related logs review application or package content status or you can take things one step further and add the ability to pause everything in your task sequence (much like debuggers can step through commands on a compiler).The ability to pause a task sequence gives you the power to perform diagnosis during a deployment and also means that you can monitor a step while it's happening (to check how variables are being set/read/or whatever) rather than reviewing the logs after the event (sometimes the logs will roll over and you'll miss the failure altogether). This method uses serviceUI.exe from the Microsoft Deployment Toolkit. You do not need to use MDT or have MDT integrated with Configuration Manager to use this method.Step 1. Prepare a package containing the required filesIn this guide we'll use ServiceUI.exe from the MDT 2012 Update 1 files package. This file allows us to popup messages and run interactive actions with users while in SYSTEM context. Simply locate the exe (found by default in C:\ProgramFiles\Microsoft Deployment Toolkit\Templates\Distribution\Tools\X86)and copy it into a new folder called Task Sequence Tools.Note: There are two versions of ServiceUI.exe, one is 32 bit (in the X86 folder) and the other is 64 bit (in the X64 folder). The boot image attached to your task sequence will decide which version of ServiceUI.exe you need to use, so if you are using a 32 bit boot image, you must use the X86 version of ServiceUI.exe otherwise you'll get an error when trying to run it.Download pause_ts.vbs.txt and copy it into our Task Sequence Tools folder. Rename the file from pause_ts.vbs.txt to pause_ts.vbs so that our folder looks like thisStep 2. Add our package to Configuration ManagerIn the software library, expand Application Management, Applications, Packages, right click and choose Create Package.fill in some info about the package and set the UNC path of the source of the Task Sequence Tools folderchoose Do Not Create a Programand continue through the wizard until completion.Step 3. Distribute our packageLocate the package you just created, right click it and choose Distribute Content.click next when the wizard appearsadd one or more Distribution Points by clicking on Add and selecting Distribution Pointand continue that wizard until it is completed.Step 4. Add the Pause Task Sequence step to a task sequenceIn Operating Systems, browse to Task Sequences and locate a task sequence you want to troubleshoot, and right click on it and choose Edit. in the task sequence editor, locate a section of the task sequence that you want to troubleshoot and click on the drop down menu Add, then select General, and Run Command Line. give the step a suitable name like ##### Pause Task Sequence, the ##### makes the line stand out in a big task sequence which makes it easier to find later (so that you can remove it once you've fixed the problem). Tip: you should place a Pause Task Sequence step directly before and directly after the step (or Group) you want to monitor, and that step should also have the option 'continue on error' selected during troubleshooting. This will mean that the task sequence will pause before and after the section of the task sequence that you are having trouble with, allowing you time to review logs, gather files, determine the issue. and in the command line paste in the following serviceUI.exe -process:TSProgressUI.exe %SYSTEMROOT%\System32\wscript.exe pause_ts.vbs then browse and select our Task Sequence Tools package as in the screenshot below (the screenshot below has two pause steps, this is so that you can check logs before and after the step that is causing you trouble in the task sequence) Step 5. PXE boot a client to test the Pause task sequence step. PXE a virtual machine and select and then start our recently edited task sequence you can either wait until it gets to the pause task sequence step or go away and do some other chores (that's the beauty of this, you can go away and when you come back the task sequence is paused waiting for you to troubleshoot.) When you get back, the task sequence will be paused and you'll see this and that of course means that you can press F8 and do some deep diving (with CMTrace showing smsts.log live) to find out why your step is failing. Once you are ready to continue the task sequence, press ALT/TAB to flick through windows on your virtual machine, click on OK on our pause task sequence step and watch the action live in CMTrace! Summary You can pause a task sequence using a simple script in conjunction with ServiceUI.exe (or by using a script in MDT Files and access that script directly after a Use toolkit Package step). Pausing a task sequence allows you to quickly get real time results and data in a failing task sequence, once you enable this ability in a task sequence you'll never look back ! have fun, cheers niall. 2 Quote Share this post Link to post Share on other sites More sharing options...
Kazi Posted August 21, 2013 Report post Posted August 21, 2013 This should be pinned. 2 Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted August 21, 2013 Report post Posted August 21, 2013 and now it is Quote Share this post Link to post Share on other sites More sharing options...
bcunjak Posted September 5, 2013 Report post Posted September 5, 2013 This is by far one of the best ways I have seen to troubleshoot a TS instead of sitting and waiting for the part where you think the issue is and looking through logs waiting for the error. Quote Share this post Link to post Share on other sites More sharing options...
tomstian Posted October 31, 2013 Report post Posted October 31, 2013 Its worth mentioning that this method allows any interaction with the user during the Task Sequence... I have used this myself in a upgrade scenario using USMT, and a recovery partitions were causing issues. I added one task to check the partitions on the disk, and ask if the user (IT person) want to delete the recovery partition or not. If the user choose Yes, the partition will be deleted, and a registry key is written to WinPE's registry. The next step is a reboot task with a condition on the registry key. I also choose to run the actual USMT task with with method as well, for to keep an eye on the USMT-output... Quote Share this post Link to post Share on other sites More sharing options...
spadge Posted November 28, 2013 Report post Posted November 28, 2013 Can this be used with configmgr 2007 and MDT 2010 Update 1? I can see the serviceui.exe within the tools\x86 folder Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted November 28, 2013 Report post Posted November 28, 2013 sure thing Quote Share this post Link to post Share on other sites More sharing options...
arovbukay Posted December 2, 2013 Report post Posted December 2, 2013 Hi, Can this be used like the LTISuspend in MDT task sequences? Quote Share this post Link to post Share on other sites More sharing options...
Ariendg Posted January 6, 2014 Report post Posted January 6, 2014 quick and dirty: create run command line with: cmd /c start "cmd" /wait cmd Quote Share this post Link to post Share on other sites More sharing options...
DietzCJ Posted May 5, 2014 Report post Posted May 5, 2014 This is actually very usefull for finding which task sequence is having the trouble. But what would be more helpfull if there a way to un-hide or turn on the task sequences with interactive mode. So that let say you have a command-line TS, and you think there is a problem in the command, the task sequence by default runs that command-line in a hidden window. Don't get me wrong, I like the hidden window for command-line task sequences.... when they work. But let's say you have the syntax wrong or something really stupid like that going on. You would never even see. Unless there is a way that someone out there knows about ? My current work around is to just create a package for that command-line and then in the program for that package have "Allow users to interact with this program" clicked. I like this pause and I do use it, but it would be nice to have this feature buitl-in. Quote Share this post Link to post Share on other sites More sharing options...