3

I am trying to run a LDAP query against AD to give me all the email addressed for a given group. I tried this but it gives me the email address for the distribution but not for the members.

I tried this (&(objectCategory=group)(Name=My-TEST-Group)) LDAP query with Mail being output but it does not give emails for the members .

I tried member as output but that gives me members CN details with this format CN=Smith\, Johne,OU=Standard Users,OU=SouthWest,OU=Active-Users,DC=NOV,DC=net

3
  • I tried this but it does not return anything. (&(objectCategory=user)(memberOf=cn=my-Test-group)). Output mail or displayname all empty
    – Green Code
    Oct 27, 2014 at 12:33
  • hmm. tried this again but no result. it returns blank. (&(objectCategory=user)(memberof=cn=my-test-group,ou=sw-users))
    – Green Code
    Oct 27, 2014 at 13:44
  • this wont return anything either. hmm. (&(objectCategory=person)(objectClass=user)(memberof=cn=my-test-group))
    – Green Code
    Oct 27, 2014 at 13:53

1 Answer 1

3

I found the problem. The problem is the memberof (at least in my environment) requires full OU.

so 2 steps. First I had to get the full OU for the given group.

(&(objectCategory=group)(cn=dg-fmog-sp-test)) and get distinguishedName

so my final query looks like following and it works.

(&(&(objectCategory=person)(objectClass=user))(memberOf=cn=my-test-group, OU=SW Distribution, OU=Email Servers, OU=Data Mining, OU=US, dc=NOV,dc=net)) and get mail

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.