Madhuri Mittal
Madhuri Mittal

Reputation: 513

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 ?

Upvotes: 4

Views: 3650

Answers (1)

Chris
Chris

Reputation: 1009

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 (i.e. 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.

Upvotes: 1

Related Questions