anyweb 478 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
Kazi 3 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
anyweb 478 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
bcunjak 2 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
tomstian 0 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
spadge 1 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
anyweb 478 Posted November 28, 2013 Report post Posted November 28, 2013 sure thing Quote Share this post Link to post Share on other sites
arovbukay 0 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
Ariendg 0 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
DietzCJ 0 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
tom2139 0 Posted June 2, 2014 Report post Posted June 2, 2014 Hello Everbody, I think I've got a big problem. Scenario:I want to execute a .exe file which interactes with an existing process. The existing process runs under user context with session id 1.Deploying a task sequence with serviceUI.exe -process:TSProgressUI.exe doesnt' work, because the task sequence and all following processes run under system context, so the process cannot interact withthe existing process.When deploying a normal task sequence (without serviceUI.exe) and checking run this step as the following account, the task sequence runs under session id 0. Basically, is there a possibility in SCCM 2012, to deploy or just execute a programm/skript with user interaction which can interact with a user context process in session 1? Quote Share this post Link to post Share on other sites
Aurock 0 Posted March 16, 2015 Report post Posted March 16, 2015 Will this work in later parts of the task sequence, such as during the State Restore phase? Or does the F8 for cmd prompt only work during the WinPE phases? Quote Share this post Link to post Share on other sites
anyweb 478 Posted March 17, 2015 Report post Posted March 17, 2015 it will work during WinPE or Windows stages of the task sequence as long as it's not during Windows setup (device driver detection stage) Quote Share this post Link to post Share on other sites
vincelewin 2 Posted February 23, 2016 Report post Posted February 23, 2016 Hi Anyweb, I tried this in my windows 10 TS and it throws this error. Failed to run the action ###########Pause Task Sequence. This version is not compatible with the version of windows your running. Check your computer's system information and then contact the software publisher. (Error: 800700D8; source: Windows) Im using the serviceUI.exe from the MDT2012 Update 1 you linked above. Im using a 64 bit boot image and the 64bit version of the serviceui.exe file. Any idea why this isnt working? Regards Vince Quote Share this post Link to post Share on other sites
anyweb 478 Posted February 23, 2016 Report post Posted February 23, 2016 hi, which version of ConfigMgr are you using and what ADK/WinPE ? Quote Share this post Link to post Share on other sites
vincelewin 2 Posted February 23, 2016 Report post Posted February 23, 2016 Hi, ADK 8.1 Build 8.100.26866 WinPE 6.3.9600.16384 is the boot image version. ConfigMgr I think its 5. Vince Quote Share this post Link to post Share on other sites
anyweb 478 Posted February 23, 2016 Report post Posted February 23, 2016 hmm it should work can you show me a screenshot of the error Quote Share this post Link to post Share on other sites
vincelewin 2 Posted February 23, 2016 Report post Posted February 23, 2016 Hi, I think it was giving the error and crashing out because I didnt have "Continue on error" ticked. Now it just flashes up the title and skips past without stopping or display the window. Quote Share this post Link to post Share on other sites
anyweb 478 Posted February 23, 2016 Report post Posted February 23, 2016 that's just parsing the step, that isn't the actual step where it's failing, show me where it's failing or better yet attach the edited smsts.log file here. Quote Share this post Link to post Share on other sites
vincelewin 2 Posted February 24, 2016 Report post Posted February 24, 2016 Ive attached the file here. smsts_win10_PauseFailed.txt Quote Share this post Link to post Share on other sites
vincelewin 2 Posted February 24, 2016 Report post Posted February 24, 2016 Is it the 401 - Unsuccessful with anonymous credentials error? It is shortly followed by an attempt to use the context credentials. 401 - Unsuccessful with context credentials error? Quote Share this post Link to post Share on other sites
vincelewin 2 Posted February 24, 2016 Report post Posted February 24, 2016 But heres the error from the log I saw. ![LOG[Failed to execute command line 'C_SMSTaskSequencePackagesCOR0012AserviceUI.exe -processTSProgressUI.exe XWINDOWSSystem32wscript.exe pause_ts.vbs' . This version of is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher. (Error 800700D8; Source Windows)]LOG]!time=085230.146+00 date=02-24-2016 component=InstallSoftware context= type=3 thread=1176 file=runcommandline.cpp562 Quote Share this post Link to post Share on other sites
anyweb 478 Posted February 25, 2016 Report post Posted February 25, 2016 are you SURE you are using the correct architecture of the serviceui.exe file ? if you took it from the wrong folder it won't work. 1 Quote Share this post Link to post Share on other sites
vincelewin 2 Posted February 25, 2016 Report post Posted February 25, 2016 Hmm, Its a 32bit boot image installing a 64bit OS. Would I use the 32 or 64bit version? I think I know what you are going to say and I think I know what I have done wrong now. V Quote Share this post Link to post Share on other sites
vincelewin 2 Posted February 25, 2016 Report post Posted February 25, 2016 Fixed. Thanks. I was using the wrong version for the boot image. 1 Quote Share this post Link to post Share on other sites