Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
user = megroup1: the only member is 'group2'
group2: the only member is 'me' Does this make sense?
In order to find indirect membership you can trace the group nesting tree and test each group. Or you can get a list of all the groups a user belongs to using "dsGetUsersGrps" and search the result for the group of interest. The second method is much easier but some users have reported problems with the "dsGetUserGrp" function when they attempt to use it on a large number of users in quick succession. You can try it for yourself to see if it will work for you.
Here is a snippet from a script that may get you started:
UserPath = "LDAP://shamrock/CN=Homer Simpson,CN=Users,DC=jClass,DC=org" TargetGroup = "Test Group" ; Get the user's group's names. GroupNames = "" Groups = dsGetUsersGrps(UserPath) Count = ItemCount(Groups, @Tab) for i=1 to Count GroupPath = ItemExtract(i, Groups, @Tab) GroupName = ItemExtract(1, GroupPath, ",") GroupName = ItemExtract(2, GroupName, "=") ;message("Group Name", GroupName) if StriCmp(GroupName, TargetGroup) == 0 then break next ; Show the result. if i < Count message(UserPath, "Is a member of %TargetGroup%") else message(UserPath, "Is NOT a member of %TargetGroup%") endif
Article ID: W16319
File Created: 2005:02:18:12:19:48
Last Updated: 2005:02:18:12:19:48