1 adding applications to the pool
Appcmd.exe add apppool/name:test.com/managedruntimeversion: "v4.0"/managedpipelinemode: "Integrated"
2 add site, specify site name, bind, physical path
Appcmd.exe add Site/name: "test.com"/id:1/bindings:http/*:81 :/physicalpath: "E:\webroot\ test.com\web "
3 designated sites for the city pool
Appcmd.exe set Site/site.name: "test.com" /[path= '/']. applicationpool:test.com
4 The default document for the specified site is index.aspx
Appcmd.exe set config "test.com/"/section:defaultdocument/+files. [@start, value= ' index.aspx ']/commit: "test.com"
5 closing script execution permissions for a specific directory
Appcmd set config "test.com/download"/section:handlers/accesspolicy:read
6 exporting all application process pools on a machine
%windir%/system32/inetsrv/appcmd list Apppool/config/xml > C:/apppools.xml
7 Exporting all sites on 1 machines
%windir%/system32/inetsrv/appcmd list Site/config/xml > C:/sites.xml
8 Import all Process pools
%windir%/system32/inetsrv/appcmd Add Apppool/in < C:/apppools.xml
9 Import All Sites
%windir%/system32/inetsrv/appcmd Add Site/in < C:/sites.xml
The following is a batch script
10 Authorization to site files
ICACLS e:\webroot\test.com\ /inheritance:e /Grant:r"IIS apppool\test.com": R
icacls e:\webroot\test.com\* /inheritance:e / grant:r "IIS apppool\test.com" :r &NBSP;
ICACLS e:\webroot\test.com\download /grant:m "IIS apppool\test.com": R
ICACLS e:\webroot\test.com\download\* /grant:m "IIS apppool\test.com": R
Set sitename=test.comset sitepath=e:\webroot\ Test.comset logpath=g:\logfileset defaultdocument= ' index.aspx ' Set is32bitapp =falseset BackPort=99set netversion=v4.0set Cache=Cache%windir%\system32\inetsrv\Appcmd add Apppool /name:%sitename% /managedruntimeversion:%netversion% /managedpipelinemode: " Integrated " /enable32bitapponwin64:false%windir%\system32\inetsrv\appcmd add site /name:"% Sitename% " /id:100 /bindings:http/*:%backport%:,http/*:80:%sitename% /physicalpath: %sitepath% /logfile.directory:%logpath%%windir%\system32\inetsrv\appcmd set site / Site.name: "%sitename%" /[path= '/'].applicationpool:%sitename%%windir%\system32\inetsrv\appcmd set config "%sitename%/" /section:defaultdocument /+files. [@start, Value=%defaultdocument%] /commit: "%sitename%" ICACls %sitepath% /inheritance:e /grant:r "iis apppool\%sitename%": RICACLS %SitePath %\* /inheritance:e /grant:r "Iis apppool\%sitename%":ricacls %sitepath%\%cache% /inheritance:e /grant:r "iis apppool\%sitename%": ricacls %sitepath%\%cache% / inheritance:e /grant:r "iis apppool\%sitename%": R
Set Sitename=test.comset Sitepath=e:\webroot\test.comset Logpath=g:\logfileset defaultdocument= ' index.aspx ' set Is32bitapp =falseset backport=99set netversion=v4.0set Cache= Cache%windir%\system32\inetsrv\appcmd Add apppool/name:%sitename%/managedruntimeversion:%netversion%/ Managedpipelinemode: "Integrated"/enable32bitapponwin64:false%windir%\system32\inetsrv\appcmd add Site/name: "% Sitename% "/id:100/bindings:http/*:%backport%:,http/*:80:%sitename%/physicalpath:%sitepath%/logfile.directory:% Logpath%%windir%\system32\inetsrv\appcmd set Site/site.name: "%sitename%"/[path= '/'].applicationpool:%sitename%% Windir%\system32\inetsrv\appcmd set config "%sitename%/"/section:defaultdocument/+files. [@start, value=%defaultdocument%]/commit: "%sitename%" ICACLS%sitepath%/inheritance:e/grant:r "IIS apppool\% Sitename% ": Ricacls%sitepath%\*/inheritance:e/grant:r" IIS apppool\%sitename% ": Ricacls%SitePath%\%Cache%/ Inheritance:e/granT:r "IIS Apppool\%sitename%": Ricacls%sitepath%\%cache%/inheritance:e/grant:r "IIS apppool\%sitename%": R
IIS7.5 APPCMD simple usage and examples