I have a MDT server that needs to run a script. This script is potentially problematic and sometimes errors out with an access denied to a network resource.

It looks like I can handle this with the 'continue on error' option to move on to the next step.

I would like to manipulate the current step attribute in some fashion if this failure occurs to rerun the previous step, effectively rerunning my problematic script.

How can I do so? My guess would be to set a variable back to the desired step name but I'm not sure the exact logic to do so, if there is anything available to see the status of the last step executed, etc. The documentation I've looked at has been lacking.

Any suggestions?


In SCCM, when a task sequence action fails, the variable _SMSTSLastActionSucceeded is set to false.

You can add a step immediately after the step that runs your script and set it to only run when _SMSTSLastActionSucceeded is false.

This will give the task sequence two chances to run your script. If you want the task sequence to keep trying the script until it succeeds, I'm sorry, I don't know how to do that.

Here is the list of task sequence variables.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.