?
Solved

Bizzare Security Issue with DirectoryEntry/Virtual Directory

Posted on 2004-04-17
5
Medium Priority
?
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 total points
ID: 10854709
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Suggested Courses

762 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