简体   繁体   English

使用PowerShell或其他脚本自动配置IIS网站/应用程序池

[英]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 . 我们的项目中需要自动化在IIS中创建AppPool和网站的过程。 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. 从我的研究中,我发现PowerShell具有可以使用的命令。 However when I tried to run IIS module commands in PowerShell on Windows Server 2012 , it does not recognize the commands. 但是,当我尝试在Windows Server 2012上的PowerShell中运行IIS模块命令时,它无法识别该命令。 Is it correct that this feature was only available for Windows 7 / IIS 7 ? 此功能仅适用于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 ? Windows 2012 R2 / IIS 8上现在也​​可以使用它吗?如果可以,我在哪里可以找到适当的文档和帮助?

This feature is of course available in Windows 8/8.1 and Windows Server 2012/2012 R2. Windows 8 / 8.1和Windows Server 2012/2012 R2中当然提供了此功能。

You probably forgot to run Add-PSSnapin WebAdministration before executing other IIS cmdlets. 您可能忘记了在执行其他IIS cmdlet之前运行Add-PSSnapin WebAdministration

You can find the full documentation on the Microsoft Technet . 您可以在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. 如果您运行Windows 8.1或Windows Server 2012 R2(即具有Windows PowerShell 4.0),则还可以将新的PowerShell所需状态配置功能与xWebAdministration模块一起使用来创建WebAppPool和网站。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Powershell命令导出远程服务器的IIS网站和应用程序池 - Powershell command to export IIS websites and app pools of a remote server 如何启动仅针对使用 Powershell 处于“已启动”状态的网站而停止的 IIS 应用程序池? - How to start IIS application pools which are stopped only for websites which has "Started" status using Powershell? 如何使用Powershell在远程服务器上运行IIS应用程序池列表? - how to operate On List of IIS Application Pools On Remote Server Using Powershell? 使用PowerShell配置IIS应用程序池设置 - Configuring IIS application pool settings using PowerShell 如何使用 Powershell 枚举 IIS 网站并找到每个网站的应用程序池? - How do I enumerate IIS websites using Powershell and find the app pool for each? 如何使用PowerShell在IIS中停止和启动各个网站? - How can I stop and start individual websites in IIS using PowerShell? 通过 powershell 或 appcmd 将应用程序池设置为在多个特定时间回收不会在 GUI/IIS 中同时显示 - Setting app pools to recycle at multiple specific times via powershell or appcmd does not display both times in GUI/IIS 我可以使用Powershell在远程IIS服务器上创建站点和应用程序池吗? - Can I create sites and application pools on a remote IIS server using Powershell? 如何使用PowerShell脚本远程启动/停止IIS 6.0 / 7.0? - How To start/stop IIS 6.0/7.0 remotely using PowerShell Scripts? 使用powershell管理单元配置IIS时如何在powershell中使用枚举类型 - How to use an enum type in powershell when configuring IIS using the powershell snapin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM