Re: Again! Help! I can't connect to Active Directory!
From: Anna Koloskova (Koloskova_at_discussions.microsoft.com)
Date: 11/23/04
- Next message: Philippe: "Problem to connect FTP server behind a proxy"
- Previous message: Angelos Karantzalis: "COM+ Singletons & instances ?"
- In reply to: Willy Denoyette [MVP]: "Re: Again! Help! I can't connect to Active Directory!"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 23 Nov 2004 03:49:01 -0800
Willy, thanks a milliion for this!
The new thread was indeed working under local ASPNET account.
Explicit login and password in DirectoryEntry object did not work for me,
but I've passed System.Security.Principal.WindowsIdentity.GetCurrent() from
the calling process and impersonated it before doing directory search.
Thanks again
Anna
"Willy Denoyette [MVP]" wrote:
> You should bind using explicit credentials when using this from asp.net.
>
> 1. Supply explicit credentials
> dirEntry = new DirectoryEntry("LDAP://......",
> "account@domain", "pwd", AuthenticationTypes.Secure));
>
> 2. Use the above dirEntry object in DirectorySearcher overload in your
> asynchronous delegate procedure.
> DirectorySearcher mySearcher = new DirectorySearcher(dirEntr, ...);
>
> You have to make sure both DirectoryEntry and DirectorySearcher are using
> the same connection. If you don't pay attention to this you will end with
> two connections using different credentials. The reason for this is that
> both run on separate threads, in your case, one is impersonating while the
> other runs with the default process identity, with as result two different
> connections with different access tokens.
>
> Willy.
>
> "Anna Koloskova" <koloskova@hotmail.com> wrote in message
> news:2c04d3d2.0411221011.5289a7c@posting.google.com...
> > Hi,
> > I'm referring to the question of Amadelle (13 october 2004), please
> > see
> >
> > http://groups.google.com/groups?q=Directorysearcher+async&hl=en&lr=&c2coff=1&selm=10mrg65nb7gnb89%40corp.supernews.com&rnum=1
> >
> > kindly answered by Jared, specifically to the words
> > ---------------------------------------------------------------------
> > "If you are able to bind, but when you try to view/retrieve the
> > properties, I
> > have found that when you try to perform operations asynchronously you
> > receive the comexception."
> > ---------------------------------------------------------------------
> > I am trying to do directory search asynchronously in ASP.Net
> > application, e.g. using begininvoke to call the function that uses
> > DirectorySearcher. I am getting COM exception "The specified domain
> > either does not exist or could not be contacted".
> > The same code called not from async call works ok.
> > Can you shed any light on this behavior? Im completely lost.
> > Thank you
> > Anna
>
>
>
- Next message: Philippe: "Problem to connect FTP server behind a proxy"
- Previous message: Angelos Karantzalis: "COM+ Singletons & instances ?"
- In reply to: Willy Denoyette [MVP]: "Re: Again! Help! I can't connect to Active Directory!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|