Last post Oct 19, 2007 08:27 AM by OWScott
Oct 18, 2007 11:42 AM|jharwood|LINK
I know this topic has been covered but I have not seen an answer to my issue. I have a website that when a user fills out a form it copies a folder and make the necessary changes to make it function as another portion
of the website. The problem that I am having it that I need to add an iis virtual directory into the directory that is created.
This is not the only website on this server. This is the code that I am using:
I am getting :
System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
I saw someone say that DirectoryEntry is for ActiveDirectory and Not IIS. If this is the case can someone tell me what to use instead.
Oct 19, 2007 08:27 AM|OWScott|LINK
I didn't review the code itself but I have a couple comments:
- The worker process of the website that hosts this tool needs to have access to make these changes in IIS. It pretty much needs to be an administer. Be careful with that though because if anyone else has access to run their own code under a site that
has admin provileges , they can do whatever they want on the server. If this is IIS6, create a site, place it in its own app pool and set both the app pool identity and the anonymous user (or authenticated user) on the site to have administrative permissions.
- DirectoryEntry should work just fine.