F C
F C

Reputation: 143

Batch create ASP.net application folders IIS 7

We have a set of about 30-50 users who periodically need an ASP.net (version 4) application directory created for them.

As these numbers grow, manually creating an application directory for each user becomes cumbersome on IIS 7.

Is there a way to create these application folders using a batched/scripted/automated mechanism of some kind?

Ideally we'd like to provide input parameters of a file that contains a batch of application-names, and have the script automatically create the application directories in IIS.

Upvotes: 1

Views: 999

Answers (3)

amit_g
amit_g

Reputation: 31250

You can use the command line tool and script is according to your own needs.

Getting Started with AppCmd.exe

Configuring IIS 7 from the command line using Appcmd.exe

Upvotes: 2

Marnix van Valen
Marnix van Valen

Reputation: 13673

You may want to take a look at Web Deploy. It allows non-admin users to deploy web applications to IIS7 servers, even remotely from a command line.

Upvotes: 3

Anton Gogolev
Anton Gogolev

Reputation: 115779

It seems like you're reinventing multitenancy.

As to your question, I think it's quite possible (and from what I see, pretty easy as well) to control IIS 7 from C#. See this for more info:

ServerManager serverMgr = new ServerManager();
Site mySite = serverMgr.Sites.Add("MySiteName", "C:\\inetpub\\wwwroot", 8080);
serverMgr.ApplicationPools.Add("MyAppPool");
mySite.ApplicationDefaults.ApplicationPoolName = "MyAppPool";
mySite.TraceFailedRequestsLogging.Enabled = true;
mySite.TraceFailedRequestsLogging.Directory = "C:\\inetpub\\customfolder\\site";
serverMgr.CommitChanges();

Upvotes: 3

Related Questions