>I am attempting to use LDAP to retrieve a list of users from within a web
>service. When the FindAll() method is invoked, I receive the following
>exception: "The specified domain either does not exist or could not be
>contacted."
This either means your LDAP path is invalid (but since you didn't
specify any, that's not likely :-), or then you have an issue with
permissions (most likely). Most likely, the user context the web
service runs under is not privileged to reach into your corporate AD.
I would assume that if used from a web service, you'll need to provide
explicit credentials to use in your LDAP query. You can do this by
instantiating the DirectoryEntry for the root of your search
separately:
DirectorySearcher ds = new DirectorySearcher();
DirectoryEntry deRoot = new
DirectoryEntry("LDAP://yourserver01.yourdomain.com/ou=SomeOU,dc=yourdomain,dc=com",
"your user name", "your user password", AuthenticationTypes.Secure);
ds.SearchRoot = deRoot;
and so forth....
Provided that user you specify is privileged enough to query the AD,
you should be able to run this code and get data back.
Marc
Chris Kormann - 27 Mar 2006 20:11 GMT
Thanks Marc, I think that did it.
Chris
> >I am attempting to use LDAP to retrieve a list of users from within a web
> >service. When the FindAll() method is invoked, I receive the following
[quoted text clipped - 24 lines]
>
> Marc