Link to home
Start Free TrialLog in
Avatar of 249Central
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?
Avatar of EDDYKT
EDDYKT
Flag of Canada image

?

Dim grp
Dim memberList
Dim member

Set grp = GetObject("WinNT://yourdomain/yourdomaingrpname")
Set memberList = grp.members
For Each member In memberList
  Debug.Print member.Name & "(" & member.Class & ")"
Next
ASKER CERTIFIED SOLUTION
Avatar of dlwyatt82
dlwyatt82
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial