Solved

Bizzare Security Issue with DirectoryEntry/Virtual Directory

Posted on 2004-04-17
5
227 Views
Last Modified: 2013-11-15
Hey everyone,

I'm having a heck of a time getting this to work:

DirectoryEntry root = new DirectoryEntry( "IIS://localhost/W3SVC/1/Root" );
DirectoryEntry vdir = root.Children.Add( "MyVirtualPath", "IIsWebVirtualDir" );
vdir.CommitChanges();

On commit changes, the following error occurs:

[UnauthorizedAccessException: Access is denied.]
   System.DirectoryServices.Interop.IAds.SetInfo() +0
   System.DirectoryServices.DirectoryEntry.CommitChanges()
   Default.Page_Load(Object sender, EventArgs e) in \\server\wwwroot$\userfolders\default.aspx.cs:39
   System.Web.UI.Control.OnLoad(EventArgs e)
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Page.ProcessRequestMain()

 The *only* way that I can get this to work is to add NETWORK SERVICE to the administrators group.  Seems sort of extreme.  Does anyone have any insight on what I need to do to my NETWORK SERVICE to allow it to CommitChanges to a DirectoryEntry object?  I've tried tweaking with the Local Policy privileges with little luck.  Also, this server is on a domain, so I'm not sure if that plays a role somehow (I tried looking in the Domain Policy and didn't see anything fishy).

Thanks!
0
Comment
Question by:TivexExchange
  • 2
5 Comments
 
LVL 28

Expert Comment

by:mmarinov
ID: 10852264
what is authentication for this virtual directory?
also have you remove the anonimous access to this virtual directory ?

B..M
0
 

Author Comment

by:TivexExchange
ID: 10854102
It's set to Windows Auth and yes I have removed annon. access.
0
 
LVL 28

Accepted Solution

by:
mmarinov earned 500 total points
ID: 10854709
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now