|
From: Bjorn O. G. <bjo...@it...> - 2005-09-17 20:32:07
|
Heiko Noordhof: > > Hi, > > Is it possible with python-ldap to request de directory-context(s)a > certain ldap-server provides? What I mean is: say my openldap server > serves 2 databases: > dc=example,dc=com > dc=heiks,dc=nl > > Then, when my app (using python-ldap) connects to the server, is it > possible to retrieve these DN's? If so, how? If not, wouldn't it be a > nice feature? The equivalent search using ldapsearch (commandline utility) is ldapsearch -x -b "" -s base "objectClass=*" namingContexts Explanation: empty base, base-search (i.e. not one-level or subtree search).. then search for basically any object and retrieve only attribute namingContexts. The above searchfilter and attribute retrieval is only valid for OpenLDAP. Other LDAP-implementations differ slightly. We use this feature in Luma(.sourceforge.net) for automatic fetching the suffixes a given server handles. -- regards Bjorn Ove Grotan |