249Central
asked on
AD Primary Group - LDAP problem
I know how to take a users PrimaryGroupID and get the Primary Group that the user belongs to. My problem is going the other way .... for example, taking the Domain Users group and trying to determine all users in that group (even the ones that have it set as their Primary Group).
What are some ways of doing this? Is it something like getting all User objects in a Domain, then looping through all of them seeing which objects have that group set as their Primary group?
What are some ways of doing this? Is it something like getting all User objects in a Domain, then looping through all of them seeing which objects have that group set as their Primary group?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim grp
Dim memberList
Dim member
Set grp = GetObject("WinNT://yourdom
Set memberList = grp.members
For Each member In memberList
Debug.Print member.Name & "(" & member.Class & ")"
Next