Skip to Content
0
Former Member
Jul 18, 2008 at 11:06 AM

Returing a user's groups from Active Directory

57 Views

Hi there,

I have recently connected Crystal Reports XI to AD 2003. I am able to pull back a user's data like sAMAccountName, givenName etc etc.

However i am unable to pull back the groups that a user is assigned to. I am thinking this might be because they have multiple groups assigned to them?

Here is the code i am using to select and return the data for name etc:

SELECT sAMAccountName, givenName, sapuserName FROM 'LDAP://OU=User Accounts,
DC=company,DC=com' WHERE objectClass='user' AND objectCategory='Person'

How would one return a user's groups that they are assigned? I have tried entering the memberOf field in my code, but this returns empty.

Any help?

Thanks,

Bernard.