How do I find out group is empty?
Hello all, I'm trying write a workflow that will check for groups that are empty (no group members) for x days and delete. issue is whats the attribute on a group that says the group is empty and for how long. Any help would be really helpful.
September 2nd, 2010 6:33pm

Is the requirement only for static/explicit membership groups, or dynamic groups as well? Here is one approach that would work for static groups, though I'd like to hear what others have in mind as this is not a scenario I've encountered among customers yet: 1. Add an attribute to the Group schema: LastEmptyMembershipDate (or some other name you prefer). 2. Create a workflow that will check to see if the group has any members. You can do this via the following query: /Group[ObjectID = 'ObjectID of the group in question' and ExplicitMember = /Resource]. If the query returns the group, then it's membership is not empty, because its ExplicitMember attribute has a value. If the query does not return the group, update the value of its LastEmptyMembershipDate to the current DateTime. 3. Create an MPR that triggers the workflow above when there is a request to remove a value from the ExplicitMember attribute of a group. 4. Create a set of all groups whose LastEmptyMembershipDate is older than x days from the current date, where x is the threshold duration a group is allowed to remain with empty membership. 5. Create a temporal MPR that runs a workflow to delete the target object (in this case a group) when a group transitions into the set above. - Nima
Free Windows Admin Tool Kit Click here and download it now
October 14th, 2010 10:37am

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

Other recent topics Other recent topics