pghtech
pghtech

Reputation: 3702

How can I configure IIS 6 programmatically?

I see that there is a nice library Microsoft.Web.Administration that allows you to configure IIS 7. It appears that Microsoft.Web.Administration doesn't work for IIS6, so I am trying to see if someone can provide some alternative suggestions.

I am building a Windows Form Application that will allow you to implement all the properties required to configure (Website, Virtual directories, Application pools...etc).

Upvotes: 1

Views: 990

Answers (2)

Marvin Smit
Marvin Smit

Reputation: 4108

To configure IIS6 you will have to revert to the System.Directory services.

string iisPath = "IIS://localhost/W3svc/1/Root";
DirectoryEntry IISRootEntry = new DirectoryEntry(iisPath);

and take it from there.

Hope this helps,

Upvotes: 3

Dan Davies Brackett
Dan Davies Brackett

Reputation: 10071

There is a massive VB script called ADSUtil.vbs that lives in IIS's admin directory that can be used to configure IIS in a scripted, if not programmatic, way. You could either call out to it, or read it and rip off its internals.

Upvotes: 1

Related Questions