-1

I am new to ldap programming. My aim is to to get the list of all the user ids from a particular group in Active Directory. I am implementing this using page control as the number of user's are large. I am doing this for Active Directory using the win32 LDAP library.

The following is the sequence,

1> Initialise: connect and bind 2> Create your page control

ldap_create_page_control

3> Set the base, filter's and attributes

search base : CN=SSOGroup,CN=Users,DC=MyDomain,DC=local)
CHAR *atribs[] = {"Department", "samAccountName", NULL};
char *filter = "(objectClass=user)";

4> Performed the search using, ldap_search_ext_s

5> Got the result and number of entries found.

6> used ldap_get_dn to get the DN

7> Check the cookie if there is another page, If yes go and do the same

8> Finalising steps

My question, How can i get the user ids at step 6 instead of DNs?

Will be helpful if you give me some pointers for me to investigate further.

Thanks

Raj
  • 1,113
  • 1
  • 17
  • 34
  • Maybe because the title of your question is about the simple paged result control, but the story doesn't match the title? – marabu Jan 17 '17 at 09:29

1 Answers1

0

If you change search base to CN=Users,DC=MyDomain,DC=local and use (memberOf=CN=SSOGroup,CN=Users,DC=MyDomain,DC=local) as your search filter, you should get what you want.

marabu
  • 1,166
  • 7
  • 9