UnboundID LDAP Java SDK - need to list descendants of a given parent DN

Venkateswaran

How do I query all descendants of a parent entry in LDAP using UnboundID LDAP SDK?

I am looking for something like a Filter which can say filter based on parent DN. Or some way to list all children of a given Entry.

Is either of it possible using UnboundID LDAP SDK? I am unable to find an example or documentation that mentions this kind of an operation.

jwilleke

Sure the descendants of any container should be obtained by using LDAP Search Scope

And in UnboundID the Class SearchScope is used in the SearchRequest and shown in their example:

 // Construct a filter that can be used to find everyone in the Sales
 // department, and then create a search request to find all such users
 // in the directory.
 Filter filter = Filter.createEqualityFilter("ou", "Sales");
 SearchRequest searchRequest =
      new SearchRequest("dc=example,dc=com", SearchScope.SUB, filter,
           "cn", "mail");
 SearchResult searchResult;

 try
 {
   searchResult = connection.search(searchRequest);

   for (SearchResultEntry entry : searchResult.getSearchEntries())
   {
     String name = entry.getAttributeValue("cn");
     String mail = entry.getAttributeValue("mail");
   }
 }
 catch (LDAPSearchException lse)
 {
   // The search failed for some reason.
   searchResult = lse.getSearchResult();
   ResultCode resultCode = lse.getResultCode();
   String errorMessageFromServer = lse.getDiagnosticMessage();
 }

-jim

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Java LDAP - Determine if user in a given group?

From Java

How to check user password in ldap whith java with given LdapContext?

From Java

Java question (calling methods with parameters) using UnboundID LDAP SDK api

From Dev

Is LDAP DN case insensitive?

From Dev

how to read attributes for given DN in ldap3 (how to search with ldap3 if no filter)

From Dev

Recursive search for descendants by parent ID

From Dev

How to count descendants given multiple parent nodes?

From Dev

How is possible to specify multiple servers for LDAPConnection using Unboundid SDK?

From Dev

How to use UnboundID SDK to connect to an LDAP server with the SSL server certificate?

From Dev

Closure event delegation - event listener on DOM parent that covers children/descendants of a given class

From Dev

How do I list root DN's using python ldap?

From Dev

UnboundID vs Apache LDAP APIS

From Dev

How to reuse an LDAP connection in Unboundid LDAP SDK?

From Dev

Matching substring within LDAP DN using Awk

From Dev

xpath parent and descendants in scrapy

From Dev

Working with multiple threads and Connectionpool in UnboundID LDAP

From Dev

List child records not linked to a given parent

From Dev

php ldap retrieve ou value of dn

From Dev

Getting Parent DN in LdapTemplate call

From Dev

Java LDAP get Group DN by using CN

From Dev

Need help in list Java

From Dev

Need help translating Powershell -> Javascript for LDAP (dn -> canonicalName) conversion function

From Dev

Need to make a list by splitting the given string in python

From Dev

XPath for parent's sibling descendants

From Dev

ldap queries - need the dn of the users who are authenticated via ldap protocol and their IP address

From Dev

Find all descendants of a parent in sql, including descendants of descendants

From Dev

bash: FQDN to an LDAP DN string

From Dev

Is there way to use ObjectGuid instead of dn in ldap api?

From Dev

Struggling with LDAP query base DN vs filter

Related Related

  1. 1

    Java LDAP - Determine if user in a given group?

  2. 2

    How to check user password in ldap whith java with given LdapContext?

  3. 3

    Java question (calling methods with parameters) using UnboundID LDAP SDK api

  4. 4

    Is LDAP DN case insensitive?

  5. 5

    how to read attributes for given DN in ldap3 (how to search with ldap3 if no filter)

  6. 6

    Recursive search for descendants by parent ID

  7. 7

    How to count descendants given multiple parent nodes?

  8. 8

    How is possible to specify multiple servers for LDAPConnection using Unboundid SDK?

  9. 9

    How to use UnboundID SDK to connect to an LDAP server with the SSL server certificate?

  10. 10

    Closure event delegation - event listener on DOM parent that covers children/descendants of a given class

  11. 11

    How do I list root DN's using python ldap?

  12. 12

    UnboundID vs Apache LDAP APIS

  13. 13

    How to reuse an LDAP connection in Unboundid LDAP SDK?

  14. 14

    Matching substring within LDAP DN using Awk

  15. 15

    xpath parent and descendants in scrapy

  16. 16

    Working with multiple threads and Connectionpool in UnboundID LDAP

  17. 17

    List child records not linked to a given parent

  18. 18

    php ldap retrieve ou value of dn

  19. 19

    Getting Parent DN in LdapTemplate call

  20. 20

    Java LDAP get Group DN by using CN

  21. 21

    Need help in list Java

  22. 22

    Need help translating Powershell -> Javascript for LDAP (dn -> canonicalName) conversion function

  23. 23

    Need to make a list by splitting the given string in python

  24. 24

    XPath for parent's sibling descendants

  25. 25

    ldap queries - need the dn of the users who are authenticated via ldap protocol and their IP address

  26. 26

    Find all descendants of a parent in sql, including descendants of descendants

  27. 27

    bash: FQDN to an LDAP DN string

  28. 28

    Is there way to use ObjectGuid instead of dn in ldap api?

  29. 29

    Struggling with LDAP query base DN vs filter

HotTag

Archive