When using a mandatory OSD advertisement to install a Operating system it is a great benefit to remove the computer from the Collection to where the OS deployment is advertised. The OSD task sequence advertisement can then be set to always rerun and all problems related to reinstalling an existing computer is solved.
This can be achieved by using a status filter rule together with a VBscript which removes the computer from the collection once the Task Sequence completes successfully.
I have updated the script to search for active computer records in SCCM using the name and then removing the computer from the collection using the ResourceID instead of using the name for matching. I have seen at customers that some third party applications created direct memberships with a different naming convention than the SCCM Admin Console does, this updated script will solve this problem.
The script have been updated with the possibility to enter more than one collection to remove the computer from, it can also write an event to the event-log on the SCCM server with the name of the computer and the collection/collections it will be removed from.
I have removed the script code from this blog and made it available as a file instead, to avoid problems when cut/pasting the text.
You can download it here: http://ccmexec.com/wp-content/uploads/2010/12/Remove.vbs.txt
Download the script and save it as “remove.vbs” edit the following line with the collection/collections you want the computer removed from
sCollectionIDs = “00100053:0010004A:00100069″
when that is done, complete the steps below to configure the status filter rule.
Configuring the status filter rule:
- Under site settings create a new status filter rule
- Configure it to use the following settings:
Component : Task Sequence Manager
Message Id: 11171
Run a Program: cscript.exe e:\sccmtools\remove.vbs %msgsys