Your company's ad could live here and reach over 50,000 people a month!

Share This Post

Working with Task Sequence Variables, a Conditional Reboot

Posted in ConfigMgrSCCMTask Sequence

I recently had someone contact me that was looking for a way to add a conditional restart to a Task Sequence, but only if an application was successfully installed.  Figured this would make a nice blog post, since if someone asked about it, chances are someone else also would like that information.

The first thing we need to do is to set a Task Sequence Variable that we can use for the Restart Computer step.

First, lets create a new Task Sequence variable and call it AppInstalled1 and set it to True.

image

Next we want to set a condition on the set TS Variable step, so that it only sets the variable to True if the application is installed. In this example, I’m going to check for the existence of something.exe, however you could also use a MSI product code, or check for a folder, or any number of available conditions.

image

Available options you could use to detect for the installation of software. Most common would be file, folder, registry, or installed software (MSI).

image

Next, we would add our Restart Computer Task Sequence step. Make sure you configure it to boot into the appropriate OS, be that WinPE or the currently installed OS, depending on where you are running this step.  Typically if we are talking about software installs, then we are running in the full OS.

image

On the Restart Computer Task Sequence step, we need to set a condition that looks for the existence of our custom variable AppInstalled1, being set to True. This way the reboot will only run if we detected the application to be installed and the variable was set to True.

image

This just a really quick of way of basing a restart task on the condition of a variable. There are other ways to accomplish similar behavior as well.

Hope it helps!

Share This Post

I am a Microsoft MVP for System Center Configuration Manager and owner of Nackers Consulting Services, LLC. I focus primarily on System Center Configuration Manager and the Microsoft Deployment Toolkit. In addition to helping clients leverage the technologies they use, I enjoy spending a lot of time on the forums and email lists helping answer questions and just seeing what people are doing with the deployment technologies available to them. I have spoken at Microsoft Management Summit on ConfigMgr/MDT integration and I have spoken at user groups around the country. If you have any questions, please feel free to contact me, I am always willing to help.

Leave a Reply