Last week I already did a post about a new task sequence variable and this week my post will be about another new task sequence variable. This one will probably be used a little less, but can be very useful in some specific situations. Think about situations where an action needs to be performed directly after the task sequence is finished, without impacting the status of the task sequence. In this post I will use a situation where I want the machine to shutdown at the end of the task sequence, as an example.
Just like last week, the configuration is actually very easy and it’s just more about knowing that the task sequence variable exists. This is another new task sequence variable in ConfigMgr 2012 SP1, which is currently still in BETA, named SMSTSPostAction. This task sequence variable can be used to configure a post action for a task sequence. To configure this, follow the next steps:
- Open a task sequence in the Task Sequence Editor.
- Add a Set Task Sequence Variable –step to the task sequence.
- Fill in as Task Sequence Variable SMSTSPostAction and, in this example, as Value cmd /c shutdown /s /t 0 /f.
- Close the Task Sequence Editor.
Normally adding a shutdown action to a task sequence would cause the task sequence to fail, but now the task sequence will first end successfully and then it will perform the shutdown. A look at the deployment status will show this result. And of course I can show a screenshot of that or of a turned off machine, but I think the SMSTS.log will show some more useful information. As the SMSTS.log will also log the post action.
Keep in mind that the SMSTS.log will register the action, but does not register a success or failure of the action.