Greetings,

I am trying to create a Virtual Directory on IIS 6.0 using the .Net
framework.

The problem is that I am always getting "Access is Denied" when I am
trying to commit the changes.

Can anyone help me in explaining what permissions are required to commit
changes to ADSI? and how can I configure them?

Pasting the code and the reference article for your reference.

Reference Article : http://www.15seconds.com/issue/010710.htm

Sample Code :
------------------------------------------
DirectoryEntry dirEntry = new
DirectoryEntry(@"IIS:\\localhost\W3SVC\1\Root");

DirectoryEntries rootEntries = dirEntry.Children;

DirectoryEntry newVirtualDir = rootEntries.Add(ApplicationName,
dirEntry.SchemaClassName);

newVirtualDir.CommitChanges(); // This is the line that throws the error
access deined.

Looking forward to hear from you.

Regards,
Jinesh Udani

Re: IIS 6.0 ADSI Secutiry by David

David
Wed Sep 10 23:33:32 CDT 2003

By default, you must be an Administrator in order to be able to make any
configuration change.

Either you run the .Net code on the server as administrator, or make sure
your remote webpage-based access to this code is authenticated using an
Administer account.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Jinesh Udani" <news1@jinesh.com> wrote in message
news:%23mu2LUydDHA.2416@TK2MSFTNGP09.phx.gbl...
Greetings,

I am trying to create a Virtual Directory on IIS 6.0 using the .Net
framework.

The problem is that I am always getting "Access is Denied" when I am
trying to commit the changes.

Can anyone help me in explaining what permissions are required to commit
changes to ADSI? and how can I configure them?

Pasting the code and the reference article for your reference.

Reference Article : http://www.15seconds.com/issue/010710.htm

Sample Code :
------------------------------------------
DirectoryEntry dirEntry = new
DirectoryEntry(@"IIS:\\localhost\W3SVC\1\Root");

DirectoryEntries rootEntries = dirEntry.Children;

DirectoryEntry newVirtualDir = rootEntries.Add(ApplicationName,
dirEntry.SchemaClassName);

newVirtualDir.CommitChanges(); // This is the line that throws the error
access deined.

Looking forward to hear from you.

Regards,
Jinesh Udani