Case:
You use required deployments on your OSD task sequence with a "always rerun" option. You like to remove that client from OSD collection as soon it has finished deploying successfully.Solution:
Go to technet and download this script.https://gallery.technet.microsoft.com/Remove-client-from-SCCM-92cc46e0
Edit the script and change the values:
Save the
script and copy it to the SCCM primary server.
Open the
Configuration Manager Console
Go to
\Administration\Overview\Site
Configuration\Sites
1. Give it a name: Remove from
OSD collections where TS "bla bla" are deployed.
2. Tick Source
3. Choose Client
4. Tick Message ID
5. Insert 11143
which is the message ID for a successful finalized task sequence.
6. Click on Actions pane.
1. Tick Run a program
2. Insert
(where PRI00023 is the package ID of the task sequence)
3. Click OK
Logging
looks like this:
Now the client will be removed from any collection where that task sequence are deployed.
Thanks to Max and Holger who contributed to the script.