LDAP namingContext

  • Thread starter Thread starter Paralleltangent
  • Start date Start date
P

Paralleltangent

Hello,

Anyone able to grab the namingContext using C# with an openldap
backend using directory entry?

For example:
DirectoryEntry de = new DirectoryEntry("LDAP://" + serverName,
userName, password, AuthenticationTypes.Anonymous);

A object of type OpenLDAProotDSE is returned but contains a null
value.

Thanks,
Kevin
 
Anyone able to grab the namingContext using C# with an openldap
backend using directory entry?

Bind to the LDAP://RootDSE object - it should contain those kind of
things. That's a basic LDAP requirement - should be implemented by any
decent LDAP server.

Also maybe try "defaultNamingContext" instead of "namingContext".

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
I encountered the same problem, but the solution is the following:

DirectorySearcher ds = new DirectorySearcher(de);
ds.SearchScope = System.DirectoryServices.SearchScope.Base;
ds.PropertiesToLoad.Add("namingContexts");
SearchResult searchResult = ds.FindOne();
SearchResultCollection results = ds.FindAll();

String namingContexts = searchResult.Properties["namingContexts"][0].ToString();

Hope this will help someone sometime,
Cipr

From http://developmentnow.com/g/36_2004_11_0_0_17428/LDAP-namingContext.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
Back
Top