I do have one domino group (Access Control List only), lets call them Main_Group.
This group includes all employees, that I want to know on which other domino groups they are member of.
Members of Main_Group:
- John Smith/ORGANIZATION
- Peter Smith/ORGANIZATION
- Jeff Smith/ORGANIZATION
Of course this list is much longer then these 3 entries.
I would look for each member in this group, in which other domino group this user is member and put this information into a CSV. The CSV should have a format like this:
UserName;DominoGroups
John Smith;Domino_Group1,Domino_Group2,Domino_Group3
Peter Smith;Domino_Group2
Jeff Smith;Domino_Group1,Domino_Group3
Whats the best way to achieve to this information? Lotus Script, any View with formula? Or is there already a notes database is doing this?
This code builds a list of dynamic arrays to act as key/value pairs (where each value is an array). It's built from the
Groupview innames.nsf. Rather than taking each group name and loading up the members, it builds it the other way round so for each member, it has an array of groups. Groups can be in other groups so it runs through each group recursively. In order to prevent loops (e.g. where group A is in group B and vice-versa) it uses thevisitedarray which terminates that part of the search if the group has already been visited. The visited array ends up, upon completion of the recursion, the list of groups the user is in.Building the key/value List initially would be quicker than multiple full text searches, especially if, rather than looking up one name, you're looping all user names in names.nsf as once the key/value list is built there's no need to query the database again. I've not built the loop for each user but it could be added quite easily to the
getGroupsForUserfunction.Code below
getGroupsForUserfunction. Returns a formatted string of each group that a user is in. The user name is the first item.getGroupKeyValuesloops through the Groups view in names.nsf and creates the key/value List.searchGroupsRecursiverecursively searches each group, ensuring no group is visited twice.