Home All Groups Group Topic Archive Search About

Directory (LDAP) search error 0x8007203A

Author
21 Sep 2006 1:21 PM
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

Author
21 Sep 2006 8:35 PM
Marc Scheuner
Show quote
>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
Author
22 Sep 2006 11:23 AM
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



Show quote
"Marc Scheuner" <no.spam@for.me> schrieb im Newsbeitrag
news:ant5h2d9pckapmbulpbcmastajp7ajnrnk@4ax.com...
> >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
Author
22 Sep 2006 7:50 PM
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
Author
26 Sep 2006 9:04 AM
Harald
Hi Marc,
thanks for your tipp with the protocols namespace. I'll try that way...
- Harald
Author
29 Sep 2006 12:29 PM
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

AddThis Social Bookmark Button