Access is denied when calling DirectoryEntry

From: Michael (mastrauckas@appdevgrp.com)
Date: 10/29/02


From: "Michael" <mastrauckas@appdevgrp.com>
Date: Tue, 29 Oct 2002 06:31:34 -0800


Hello everyone. I have a problem i'm hoping someone can
help me with I'll copy and paste my code

DirectoryEntry objDirPar = null;
                        int iLength = 0;
                        objDirPar = new DirectoryEntry
("IIS://localhost/W3SVC/1/Root/QFDemo", "Administrator", "p
ass");
                        StringBuilder sbDefaultPage = new
StringBuilder(objDirPar.Properties
["DefaultDoc"].Value.ToString());

Now when I run this I get "Access is denied" when I call
objDirPar.Properties even though i'm using the
Adminstrator acccount in the constructor??? So I put this
into my web.config

<identity impersonate="true" userName="Adminstrator"
password="pass"/> and I get the error:

Parser Error Message: Could not create Windows user token
from the credentials specified in the config file. Error
from the operating system 'A required privilege is not
held by the client. '

The only way i can fix this problem is by changing the
machine.config xml. If I change processModel tag and
changing userName from machine to system everything works
just fine. Now this is a big security hole if I do
this!!! So is there any other way I can do this without
putting this security hole in my web application?

Also, on another note, can you share a Application
variable in ASP 3.0 with a Application variable in ASP.NET
if they're part of the same web application?

Michael



Relevant Pages

  • Re: Access is denied when calling DirectoryEntry
    ... Grant the privalege "Act as part of the operating system" (also known as ... > Parser Error Message: Could not create Windows user token ... > changing userName from machine to system everything works ... Now this is a big security hole if I do ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: DRAM data persistence
    ... This is very correct otherwise there would be a huge security hole. ... Name ONE operating system that does this. ... "- Object reuse functionality to clear file system and memory objects ...
    (sci.electronics.design)
  • Re: DRAM data persistence
    ... This is very correct otherwise there would be a huge security hole. ... Name ONE operating system that does this. ... imaginary OS feature. ... MVS, and I believe any other OS that is B2 rated. ...
    (sci.electronics.design)
  • Re: DRAM data persistence
    ... Nico Coesel wrote: ... This is very correct otherwise there would be a huge security hole. ... Name ONE operating system that does this. ... imaginary OS feature. ...
    (sci.electronics.design)