Directory (LDAP) search error 0x8007203A

H

Harald

Hi,
I'm trying to read some data with C# in .NET 2.0. I'm using the Directory
classes as follows:

...
DirectoryEntry entry = new DirectoryEntry();

entry.Path =
"LDAP://myServer.intern.myCompany.de:51000/ou=MyApplication,ou=srv,o=myCompany";
entry.Username = LDAP_APP_USER;
entry.Password = LDAP_APP_USER_PSWRD;

DirectorySearcher searcher = new DirectorySearcher(entry,
myFilter);
SearchResultCollection results = searcher.FindAll();

foreach(SearchResult result in results)
...

results.Dispose();
...

The values for Username, Password and Path (and myFilter) are correct and
access works fine within other acess software like Jxplorer. But here,
unfortunately the call "searcher.FindAll()" throws a
System.Runtime.InteropServices.COMException:

"0x8007203A: The server is not operational".
(Translated English version, we use VS2005 German)

I have no idea what to do! Thx for your appreciated help!

- Harald
 
M

Marc Scheuner

I'm trying to read some data with C# in .NET 2.0. I'm using the Directory
classes as follows:
DirectoryEntry entry = new DirectoryEntry();
entry.Path =
"LDAP://myServer.intern.myCompany.de:51000/ou=MyApplication,ou=srv,o=myCompany";
entry.Username = LDAP_APP_USER;
entry.Password = LDAP_APP_USER_PSWRD;

DirectorySearcher searcher = new DirectorySearcher(entry,
myFilter);
SearchResultCollection results = searcher.FindAll();

unfortunately the call "searcher.FindAll()" throws a
System.Runtime.InteropServices.COMException:

"0x8007203A: The server is not operational".
(Translated English version, we use VS2005 German)

I would suspect that the LDAP path is invalid / incomplete. In most
cases, it should AT LEAST also contain some dc= elements, something
like

LDAP://myServer.intern.mycompany.de/ou=MyApplication,ou=SRV,dc=MyCompany,dc=de

Also, I am uncertain if the port 51000 that you seem to specify here
is valid and will work.

Another suspicion I have is that you're trying to use the
DirectorySearcher against an LDAP store which is not really Active
Directory - that won't work, in most cases, I'm afraid. It seems that
while DirectoryEntry per se is fairly "portable" across LDAP
implementations, DirectoySearcher often is not.

Marc
 
H

Harald

Hi Marc,
as I stated - the path works and the port number is also not the matter of
concern because it all also works in jXplorer. But you are right that the
connected server is a sun machine and not a microsoft server. Is it true
that DirectorySearcher doesn't work in such cases??? And if yes - how to
make LDAP calls to such servers in .net 2.0 ???

Best regards, Harald
 
M

Marc Scheuner

But you are right that the connected server is a sun machine and not a microsoft server. Is it true
that DirectorySearcher doesn't work in such cases??? And if yes - how to make LDAP
calls to such servers in .net 2.0 ???

DirectorySEarcher has a lot more problems when hitting non-AD servers.
What you could do is use the native LDAP calls in .NET 2.0, which are
located in the System.DirectoryServices.Protocols namespace - they
should work against any LDAP standard-compliant server, but they are
often less easy and "nice" to use.

Marc
 
H

Harald

Hi Marc,
thanks for your tipp with the protocols namespace. I'll try that way...
- Harald
 
H

Harald

Hi,
my problems seem to be caused by a 1) wrong port number and by 2) an expired
SSL certificate. Examination lead to an better understanding of LDAP. Thanks
for all answers!
- Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top