ZTI - Preventing Image looping

Hello everyone, looking to get feedback from others to see how they handle the image looping potential when deploying ZTI task sequences to clients when the deployment is set to Always Rerun.

In SCCM 2007 I got around this issue by stamping the registry during the deployment to trick the client into thinking it already ran.  Previous to this method I had a vbscript that would remove the device from the collection at the end of the task sequence.

Haven't tried either of these methods yet in SCCM 2012 and wanted to see how other handle this?  Hoping there is now some secret sauce I am overlooking built in to SCCM that addresses this.

Thanks in advance!

January 10th, 2014 5:14pm


I always use a script to remove it from the collection, I run it either as a status filter rule or as a task in the task sequence...


Free Windows Admin Tool Kit Click here and download it now
January 10th, 2014 5:18pm

Thanks for the reply.  I've seen your post about the status filter method.  ;-)

Question for you on that.  Do you modify the vbscript collection variable for each deployment?  Or do you just use the same collection with new deployments?

January 10th, 2014 5:37pm

I have been doing some testing and want to see if someone an poke holes in my scenario.

What I have been testing is creating the deployment, setting it to Always Rerun, setting the assignment scheduled time and then setting the deployment to expire 15 minutes after the assignment schedule.

I have tested several times now and as I would expect, it works.  The deployment expires during the deployment itself, however it's already running and will complete to success (or failure). 

The only caveat to this scenario I can think of is that you must either:

1.  Set the Assignment Schedule at least 60 minutes (or what ever your machine policy refresh cycle is) in the future to allow your client(s) enough time to receive the policy before the deployment expires.


2.  Create the deployment (as suggested above) and use Client notification to force a machine policy retrieval  if the deployment is assigned for less than 60 minutes from creation.

Is there anything I am overlooking here?  If not this seems like a very viable alternative to scripting the removal of the client from a collection or stamping the registry.   Would love to hear anyone's opinion on this.


Free Windows Admin Tool Kit Click here and download it now
January 10th, 2014 11:20pm

For our ZTI task sequences we just use Maik Koster's web service to remove the client from the collection. Its pretty easy once you have the web service setup, etc.


One liner: cscript.exe %scriptroot%\ZTI_ExecuteWebService.wsf /wsSection:RemoveComputerFromCollection

January 10th, 2014 11:57pm

I've seen several approaches like this.  Curious how this handles "what" collection it pulls the client from?  Does the web service determine which collection is associated to the running deployment and pull it out of that collection alone?  Some of the other examples I have seem either pull the machine from ALL collections in which its a direct member (bad) or you have to create the collection and then specify that collection in the script (or as a command line parameter).


Free Windows Admin Tool Kit Click here and download it now
January 13th, 2014 9:54am

Hi William,

have you checked the different deployment Options Configuration Manager 2012 provides? You can configure your deployment type to be only available to Boot Media and PXE (I hope Network is not your first boot order, oherwise I would use a script to configure bios to boot from HDD first after the OS got successfully applied).

If you require to have multiple Task Sequences available for your Systems you might want to leverage SMSTSPreferredAdvertID variable configured via a prestart command (custom script to decide which deployment you want to start).

If your Task Sequences are available to ConfigMgr Clients (Full OS) you can for example check Install Date of the OS via WMI (Win32_OperatingSystem) and compare it to the current date (If this Delta is lower than xyz days Exit the TS). Additionaly you can use your Tattoo Option (custom registry key) you used already to abuse a query based collection to "Exclude the System from the deployment Collections".

Just some thoughts,


January 13th, 2014 1:36pm

William, since ours is a ZTI migration, we have the CollectionID specified in a variable on the collection its deployed to.
Free Windows Admin Tool Kit Click here and download it now
January 13th, 2014 2:59pm

Thanks Daniel, that makes sense. :-)

Will, Yeah, this is only talking about TS's available to ConfigMgr clients, all PXE TS's are deployed as PXE/Media only.  Kind of like the idea of adding a task in the TS that checks install date and exits.  Good stuff.

Thanks gentlemen.  Still curious to hear back from others as well on how they achieve this.  ;-)

January 13th, 2014 3:32pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics