When we do remote deployment what more convenient than a console? Once I got an opportunity to remotely deploy the web application along with supporting subsystems. Therefore I need a batch file to automate the whole deployment procedure.
One of the requirement is to setup IIS with new app pool, create VD and deploy the files needed to run the website. Following is the command to manage IIS over command prompt;
- To list all existing app pool from IIS use
APPCMD LIST APPPOOL
- To create a new app pool then use
APPCMD ADD APPPOOL /NAME:<NAME_OF_APPPOOL>
- To create app pool with integrated pipeline use
APPCMD ADD APPPOOL /NAME:<NAME_OF_APPPOOL> /MANAGEDPIPELINEMODE:”Integrated”
- To create app pool with specific .NET version, use
APPCMD ADD APPPOOL /NAME:<NAME_OF_APPPOOL> /MANAGEDRUNTIMEVERSION:”v4.0″.
- In this case I am using .NET Framework 4.0
- To enable 32-bit dlls use the flag
- To finally create the site,
APPCMD ADD APP /SITE.NAME:”Default Web Site” /PATH:/<VD_NAME> /PHYSICALPATH:<PHYSICAL_PATH_TO_VD> /APPLICATIONPOOL:<APP_POOL_NAME>