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?


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!

| improve this answer | |

When adding custom code to a deployment task sequence via a VBScript contained in a .wsf script file, you may include a set of utility objects and functions by adding the following line to your .wsf script:

<script language="VBScript" src="ZTIUtility.vbs"/>

With these utility objects available, you may then make a function call like the following to log an error to the deployment log (located at C:\MININT\SMSOSD\OSDLOGS\BDD.log).

oLogging.CreateEntry "Error - A prerequisite condition failed.", LogTypeError

Note that LogTypeError is a constant defined in ZTIUtility.vbs.

By logging an error, you are signaling to MDT that a fatal error occurred. I believe this will always then cause MDT to throw an error pop-up to the user interface, and for the deployment to be aborted automatically.

| improve this answer | |

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.