Groups | Blog | Home
all groups > dotnet sdk > april 2005 >

dotnet sdk : Connecting to IIS using ADSI


Richard Ruben
4/26/2005 11:48:01 PM
Hi
I hope somebody can help me because I really don’t know how to solve this
problem.
I want to do the following.

We have an IIS server that I want to administrate using ADSI. I did some
testing in a test domain and everything went well. This because me user
was an administrator on the server.

Now I want to do the same on a server that we have in our real domain.
My user is not an administrator on that machine.
I have been reading Q218497 where they explain that calling the API
LogonUser I can impersonate an user that is an administrator and then
connect to the server with ADSI.

That is exactly what i tried. But it doesn’t work. I call the LogonUser with
LogonType LOGON32_LOGON_INTERACTIVE so that I can make calls to remote
systems.
But when connecting to the IIS it keeps throwing an "Access denied". I
tried several ways to impersonate the user, but none of them worked.
When calling the System.Security.Principal.WindowsIdentity.GetCurrent.Name it
returns me the administrator user so the impersonate seems to be working.

I hope somebody has an answer for me.

Thanks

Richard
Willy Denoyette [MVP]
5/1/2005 12:00:00 AM
You don't need to impersonate an Interactive user, this is only needed for
interactive logons.
And you need to impersonate a local administrator (loal means the IIS
server) or a domain administrator for this to work.

Willy.


[quoted text, click to view]

AddThis Social Bookmark Button