简体   繁体   中英

Auto configuring IIS websites / app pools using PowerShell or other scripts

We have a need in our project to automate the process of creating AppPools and Websites in IIS . We would like to write some batch script to get this done. From my research I found that PowerShell has commands that can be used. However when I tried to run IIS module commands in PowerShell on Windows Server 2012 , it does not recognize the commands. Is it correct that this feature was only available for Windows 7 / IIS 7 ? Is it also available now on Windows 2012 R2 / IIS 8. If so where can I find proper documentation and help ?

This feature is of course available in Windows 8/8.1 and Windows Server 2012/2012 R2.

You probably forgot to run Add-PSSnapin WebAdministration before executing other IIS cmdlets.

You can find the full documentation on the Microsoft Technet .

If you run Windows 8.1 or Windows Server 2012 R2 (ie you have Windows PowerShell 4.0) you can also use the new PowerShell Desired State Configuration feature with the xWebAdministration Module to create WebAppPools and Websites.

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