Why an OSD Task Sequence is triggered to re-run on a CM12 client?
This is usually caused by a mandatory advertisement to a collection, when a PC is added to the collection, to start the Task Sequence.
However the PC is never removed from the collection and is left in the collection even after the Task Sequence completed.
The end result is that the PC will eventually rerun the task sequence, since the previous execution history is lost when the task sequence wipes any previous OS.
To resolve the issue, the PC needs to be removed from the collection after the Task Sequence completes.
This will prevent the new OS from picking up the policy to run the Task Sequence and it will not rerun again.
If you advertise an OSD TS to a collection, then all the systems in this collection will be targeted – prestaged or not!
You could bypass this issue by creating a test collection > advertise the TS to this test collection > and add directly the computer you want to install to that collection (Direct
membership collection). That way only those computers in the specific collection, are affected!
(but anyway, if the CM agent is uninstalled/reinstalled > it gets a new GUID > so it is listed as a “new” machine > so it will be reinstalled anyway inside this collection…
although it still doesn’t really matter since all machines will rerun the TS in that collection)
This question is kind of tricky, since it involves other parameters like the TS settings:
If there is an OSD mandatory advertisement – for example - set to “always rerun”, will have the same effect (but once a deployment completes with success , it will start to deploy the OS again
to the same device, by using that setting).
There are of course other settings like “Rerun if failed previous attempt” that you can test further - in case they fulfill your business needs:
Rerun behavior |
Specifies whether the task sequence will be rerun on the client computer if it has previously been run before the scheduled mandatory time. Options are:
|
From <https://technet.microsoft.com/en-us/library/hh967540.aspx>
In that case, you could test also, with the Deployment expiration or some of the other settings, in the Schedule Tab Properties.
(Note: if someone happens to refresh the collection when the "always rerun" deployment is still assigned, it might kick it off again..).
Schedule Tab Properties
Element
Description
Schedule when this deployment will become available
True or False (Default = False) By default, the deployment is made immediately available. If you wish to define a future date or time to make this deployment available, then set this property to True and set the associated date/time below.
Deployment Availability Time
The date/time when this deployment will be made available.
Note
If you set Schedule when this deployment will become available to True, this property is set to the current time unless set otherwise.
Schedule when this deployment will expire
True or False (Default = False) By default, the deployment does not expire. If you wish to define an expiration, then set this property to True and set the associated date/time below.
Deployment expiration
The date/time to use for the installation deadline for this deployment.
Note
If you set Schedule when this deployment will expire to True, this property is set to the current time unless set otherwise.
Mandatory Assignments
See Mandatory Assignment Schedules for more information.
https://technet.microsoft.com/en-us/library/hh967540.aspx
In order to be able to remove the direct computer association from this collection automatically - after the advertisement has finished, you may
use a script like the following:
https://social.technet.microsoft.com/Forums/en-US/9205e49b-9d0e-462e-8998-87e6c31f9c41/remove-direct-computer-association-from-collection-by-script?forum=configmgrsdk