How to check if LDAP server is up and answers? (OpenLDAP)

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Help!
I need to check (either by C# or VB .net) if a remote LDAP server (PGP server, seems to run OpenLDAP, is NOT an Active Directory thing) is up and running and available for search requests. The connection shall use anonymous credentials.
Searched the Internet now for some hours, and tried a couple of things, but always unsuccessful. (here I have to say, I am a beginner, especially in the C# area).
I tried i.e. with this code, but only get an error "Unexpected exception occured: COMException: Unknown error (0x80005000)"
<pre class="prettyprint" style=" DirectoryEntry ldapConnection = new DirectoryEntry("ldap://192.168.5.10");
ldapConnection.AuthenticationType = AuthenticationTypes.Anonymous;
DirectorySearcher ds = new DirectorySearcher(ldapConnection);
ds.Filter = "(objectClass=*)";
SearchResultCollection result = null;
result = ds.FindAll();[/code]
<br/>
It throws the exception when it comes to the last line above.
My ldap directory is up and running, I can confirm that i.e. by telnet ip port and also by LDAPBrowser with anonymous credentials and bind o=Users and the same filter like above.
Whats wrong here?? I cant make it.
Any help highly appreciated!
Klaus.



<br/>

View the full article
 
Back
Top