05 October 2017

Conditional Task Sequence Reboot in SCCM and MDT

Recently, I built and published the Dell driver update script that may or may not require a reboot. I instituted the script as a task sequence in MDT and then made the following task sequence a reboot. Thinking about it, the reboot may not be required and therefore that would be a waste of time. To get around this, I decided to investigate a conditional reboot.

In order to institute this, I used the standard Restart Computer task sequence and I added conditional parameters to the Options tab shown below.


Here is a screenshot of each of the three keys:




I have tested this by injecting the specified registry keys and these work great. One thing you will encounter when creating these to test just for the existence of the key without a value is a requirement for a value as shown below. I entered a blank space in that field and it worked.


There is one additional attribute to look at and that is a pending reboot via the configuration manager client. It is the following:

(([wmiclass]"\\.\root\ccm\ClientSDK:CCM_ClientUtilities").DetermineIfRebootPending()).RebootPending

So far, I have not been able to get this incorporated as a condition using a WQL query. Apparently, you can only use WQL for the class root\cimv2 and no others. I am likely going to have to create an additional task sequence that creates an MDT/SCCM variable with a boolean value using PowerShell. That is on my list.

0 comments:

Post a Comment