Abort MDT 2012 task sequence and deployment if pre-requisites are not met

deploymentmdt-2012wds

For an automated deployment of Windows 7 created using MDT 2012, we would like the installation to abort if certain required pre-requisite conditions are not met.

For example, the computer receiving the deployment must have a specific group membership in order to assure that post-deployment configuration is applied correctly with group policies.

I know there are several options available for adding custom logic to the task sequence – for example, we could call a web service (as described in RIS-style naming with MDT 2010: Use a web service) or we can add some script to create a custom task sequence (as described in MDT 2012, Custom Task Sequence Variable to choose between Operating System Images).

But we are having trouble determining where to add this script or web service call, and how to ensure that the deployment aborts in case the pre-requisite conditions fail.

Is there a common solution to the problem of ensuring pre-requisites are met?

Best Answer

Simply telling ZTIUtility to report an error doesn't inform the task sequencer that it failed. I believe you need to set iRetVal to anything other than "0" and then return.

What I would do if in your shoes would be to configure the web service to report group membership and then add some logic to determine if the valid group is present. If not, set iRetVal to any number and then I think you're good.

Hope this helps!