Hi, I am doing the complete impersonisation & AD stuff in a try-catch block. So fetching all the errors & log them to the database & clean up resources is done there.
According to your question: I did get this thing working by doing the following: Do not process the "ImpersonateLoggedOnUser(token)" method... A simple LogonUser(...) only, did the trick for me. I have to dig more into that because until today I do not know why ImpersonateLoggedOnUser(..) did not work on the AD for creation/modification of a new AD account. This method works if I am only looking to check if a user exists. [Speculative] Probably it has to do something with the settings in the AD forrest because the account I am using to make all the work is member on different domain then the targeted domain where all the account creations / modifications are processed. [Speculative] Dimitrios Toulakis PS: But at the end .... It works. ;-) -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of J. Merrill Sent: Monday, December 11, 2006 1:57 PM To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM Subject: Re: [ADVANCED-DOTNET] AW: [ADVANCED-DOTNET] System.DirectoryServices - same code -- different behaviour Your code ignores the result of ImpersonateLoggedOnUser. If it indicated a failure ... Did you get things working? What had to be done to make it work? At 04:10 PM 11/29/2006, Dimitrios Toulakis wrote (in part) >Hi, > >but I am setting explicit the user in ImpersonateUser(..). >And this user has full access to the AD. > >Otherwise I would not do that step..... > >Here is how the Impersonate class looks like: >[snip] > if (!justLogon) ImpersonateLoggedOnUser(token); >[snip] J. Merrill / Analytical Software Corp =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com