简体   繁体   中英

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.

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();

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM