Reputation: 143
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
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
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
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