Remove computer from all direct and query based collections as part of OSD TS
We are preparing to reimage all company computers from Windows XP to Windows 7. In our SCCM 2007 environment we have several query based or dynamic collections based on office location, departmentWe also have several collections that are direct or manual membership for specialty or licensed software. Over time several computers have been repurposed to other users but have retained their original collection memberships. When a computer gets reimaged from an advertisement it retains its name and DDR and thus remains in the same collections it was a member of prior to being reimaged and does not show up as an obsolete record. As part of the reimaging project we want to take this opportunity to start fresh and remove computers from all collections they are members as they are reimaged. Im looking for a way to automatically remove a computer from all collections it is a member of as part of an OSD task sequence. There has been a lot of work done in SCCM around user and state migration but in our case we are looking for the opposite.
May 17th, 2012 5:53pm

Removing a computer from a 'static' collection can done by script like this: http://www.petervanderwoude.nl/post/configmgr-2007-and-removing-a-computer-from-a-collection-by-script/ Removing a computer from a 'dynamic' collection, can't be done by script, as this would mean that you have to delete the record. To remove a computer from a 'dynamic' collection there is only one thing you can do and that is to make sure it's not part of the query statement anymore..My Blog: http://www.petervanderwoude.nl/ Follow me on twitter: pvanderwoude
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2012 8:43am

Thanks Peter your script works great. I found another post that uses a status filter rule to delete computers from multiple direct membership collections. http://ccmexec.com/2010/03/remove-a-computer-from-a-collections-when-osd-task-sequence-is-completed/. Unfortunately, neither work on deleting from query based collections. I also found a couple of scripts on technet for deleting computers from the database that I might be able to run as the last task in my task sequence. Once the computer comes back up after being reimaged the client will discover and come into the database as a new record. http://social.technet.microsoft.com/Forums/en/configmgrgeneral/thread/cd4fb2c7-b9e9-4633-be05-274347b30e91 http://social.technet.microsoft.com/Forums/en-US/configmgrsdk/thread/548a3289-0136-4227-bebd-3444f7f94aa0/ It seems to be hit or miss with computers in my environment when I reimage a computer using an advertisement if they come up as an obsolete record or retain their identity and remain in their original collections. When using boot media to initiate the image the computers always come up as obsolete after being reimaged. When they come up as an obsolete record thats great they fall out of all collections. If they retain their identity more times than not I get a bunch of failed advertisements in Run Advertised Programs on the client computer. There is no consistency or pattern as to which advertisements succeed or fail. Sometimes all the advertisements succeed other times a third of the advertisements fail. If I rerun the failed advertisements they succeeds every time.
May 18th, 2012 2:12pm

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

Other recent topics Other recent topics