When you’re working with ConfigMgr 2012 and task sequences, these tend to fail now and then. I’ve previously blogged about how you can re-run a required task sequence that is deployed to a client where it has for some reason failed. That blog post can be found here. Instead of logging on to each client and perform the steps in the old blog post, I chose to create a tool that can perform that for me. Of course, you could use PowerShell remoting, but there might be cases when it’s easier for one to use a tool like this. With this tool it’s possible to re-run a required (or available if you choose) task sequence locally on the client or on a remote client.

Download the tool

The tool is available on the TechNet Gallery. You’ll find the link here.

Scenario

Let’s say that we’ve deployed a task sequence that we configured as required. For some reason it failed on a particular client. We’ve now fixed the issue on the client and would like to execute the task sequence again. If you’d to open up Software Center on that client, you’ll see that the option to Install the task sequence again is not possible.

84_1

You could of course create a new deployment of the task sequence, but that might not be what you want for several reasons. Instead we can go ahead and remove the WMI object that tells the ConfigMgr client that this task sequence has already been executed. Depending on the re-run behavior on the deployment, it might solve it self in time, but if you need to remediate the situation quickly, this tool is quite helpful with just that.

Requirements

The user that executes the tool, needs to be an administrator on the client. If the tool is used on a server to remotely re-run a task sequence on a client, the user executing the tool needs to be an administrator on that client. Always elevate a PowerShell console when running the tool, or it will not work. Regular users with no administrative privileges will not be able to successfully use the tool completely.

Another requirement is if you’re using the remote functionality of the tool, to have WMI connections allowed inbound on the target client. If this is not allowed through any firewall, the tool will not work on remote clients. It could then be copied to the client instead, and executed locally.

Using the tool

Before we go ahead and uses the tool, we first need to look up what the Package ID for the task sequence that is deployed and that we want to re-run. This can easily be done by opening the ConfigMgr console, go to Software LibraryOperating SystemsTask Sequences. In the area where all your task sequences are shown to you, look for the Package ID column next to the task sequence in question.

84_2

In my scenario, the task sequence called Validate TS Script is the one that failed on my client. As you can see in the Package ID column, the Package ID for this task sequence is PS100015. Take a note of the Package ID. Assuming that you have downloaded the script from the link above and saved it to C:\Scripts on let’s your Primary Site server, we’ll now go ahead and launch it.

1. Open an elevated PowerShell console and browse C:\Scripts.
2. Run the following command:

.\Start-TSRerunTool.ps1

84_3

3. In the PackageID text box, enter the Package ID that we took a note of earlier. In my case it will be PS100015.
4. Choose whether to search locally or remote. In this case I’m gonna select remote and enter the name of my client (which is CL01).
5. Click on Search.

84_4

6. As you can see, the tool has found 1 result. In order to delete this, we should now click on the row where it says PS120005-PS100015-6F6BCC28. This string of characters will of course be something else in your environment. When you click on it, notice that in the log view, it will tell you what object has been selected.

85_5

7. Now that we’ve selected the object that we want to remove, the Delete button is enabled and we can go ahead and click on it.

84_6

8. Once the object has been removed, the Restart Agent button appears. It’s necessary to restart the SMS Agent service (CcmExec) in order to start the task sequence again.

84_7

9. Once the SMS Agent service has been restarted, the task sequence should start shortly on the client.

84_8

Now that’s it! The task sequence has successfully been re-run on a client.

Nickolaj Andersen
Principal Consultant and Enterprise Mobility MVP. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows deployments and Automation. In 2015 Nickolaj was awarded as PowerShell Hero by the community for his script and tools contributions. Author of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService and a frequent speaker at user groups.

(1666)

comments
  • Dylan
    Posted at 16:52 February 17, 2016
    Dylan
    Reply
    Author

    Great tool Nickolaj! Thank you.

  • Vaseem
    Posted at 07:05 April 25, 2016
    Vaseem
    Reply
    Author

    Thank You!

  • selim
    Posted at 11:27 August 31, 2016
    selim
    Reply
    Author

    So easy to use. Great job. Thanks

  • Leave a Reply