1. 备份
%windir%\system32\inetsrv\appcmd.exe add backup "My Backup Name"
2.还原
%windir%\system32\inetsrv\appcmd.exe restore backup "My Backup Name"
3.删除备份
%windir%\system32\inetsrv\appcmd.exe delete backup "My Backup Name"
4.查看备份
%windir%\system32\inetsrv\appcmd.exe list backup
如果要批量搬移IIS上的数据到其他的服务器,需要导出所有应用池和网站:
1. 导出应用池
%windir%\system32\inetsrv\AppCmd.exe LIST APPPOOL /config /XML > poolappcmdexport.xml
2. 导出网站配置
%windir%\system32\inetsrv\AppCmd.exe LIST SITE /config /XML > iisappcmdexport.xml
3.导入应用池
%windir%\system32\inetsrv\AppCmd.exe ADD APPPOOL /IN < poolappcmdexport.xml
4. 导入网站配置
%windir%\system32\inetsrv\AppCmd.exe ADD SITE /IN < iisappcmdexport.xml
优化machine.config
路径: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config
<processModel enable="true" requestQueueLimit="100000" maxWorkerThreads="1000" maxIoThreads="1000" minWorkerThreads="200" minIoThreads="200"/>
<processModel enable="true" requestQueueLimit="100000" maxWorkerThreads="1000" maxIoThreads="1000" minWorkerThreads="400" minIoThreads="400"/>
默认是
<processModel autoConfig="true"/>
自动安装iis
Install-WindowsFeature -ConfigurationFilePath d:\服务器\iis安装配置.xml