|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Directory (LDAP) search error 0x8007203AI'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
Show quote
>I'm trying to read some data with C# in .NET 2.0. I'm using the Directory I would suspect that the LDAP path is invalid / incomplete. In most>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) 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 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 >But you are right that the connected server is a sun machine and not a microsoft server. Is it true DirectorySEarcher has a lot more problems when hitting non-AD servers.>that DirectorySearcher doesn't work in such cases??? And if yes - how to make LDAP >calls to such servers in .net 2.0 ??? 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 Hi Marc,
thanks for your tipp with the protocols namespace. I'll try that way... - Harald |
|||||||||||||||||||||||