views:

79

answers:

3

I have the need to add Host Headers to an existing web site in IIS. I want to be able to add this host header via a Web page, ASPX page. Also, I want to able to create a new web site from file.

Sample code?
How to do I manage security issues, what issues should I be concerned about?
How many host headers can a single web site have?

I am using the ASP.Net membership provider on the site.

Server is running IIS7 and Windows 2008 Server.

A: 

IIS 7 Has a managed code API which should allow you to do what you need.

Take a look at the API documentation from Microsoft, here: http://msdn.microsoft.com/en-gb/library/aa347649.aspx

This blog may be useful, too.

Chris Roberts
A: 

Here's a code project that seems to do what you'd need. It's a windows form project but adapting it to ASP.Net shouldn't prove too difficult.

http://www.codeproject.com/KB/server-management/DirectoryServicesIIS.aspx

Spencer Ruport
+1  A: 

WMI is the best way to create website from your pages, I have used it and had referred http://blogs.msdn.com/ramesh_r/archive/2004/03/24/95109.aspx link.

This is really a cool link to understand/ learn WMI programming.

You can download WMI code generator from http://www.microsoft.com/downloads/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en

Ravia