Automatically configure IIS websites / application pools using PowerShell or other scripts

We have a need for our project to automate the process of creating AppPools and websites in IIS. We would like to write some script packages to do this. From my research, I found that PowerShell has commands that you can use. However, when I tried to run the IIS module commands in PowerShell in Windows Server 2012, it did not recognize the commands. Is it correct that this feature is only available for Windows 7 / IIS 7? It is also available now in Windows 2012 R2 / IIS 8. If so, where can I find the right documentation and help?

+4
source share
1 answer

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

You probably forgot to run Add-PSSnapin WebAdministrationbefore running other IIS cmdlets.

You can find full documentation on Microsoft Technet .

If you are using Windows 8.1 or Windows Server 2012 R2 (that is, you have Windows PowerShell 4.0), you can also use the new PowerShell desired state configuration with the xWebAdministration Module to create WebAppPools and websites.

+1
source

All Articles