【问题标题】:Setting a website's application pool in IIS using Powershell使用 Powershell 在 IIS 中设置网站的应用程序池
【发布时间】:2012-12-23 16:19:45
【问题描述】:

我需要一个相当于在 IIS 中添加网站的 Powershell 命令,但需要“应用程序池”的绑定:

到目前为止,我可以添加一个这样做的网站:

New-Item iis:\Sites\swmarket -bindings @{protocol="http";bindingInformation="80:swmarket"} -physicalPath c:\inetpub\wwwroot

但我不知道如何在新网站中设置“应用程序池”。有什么方法可以查看所有绑定?

【问题讨论】:

标签: iis powershell application-pool


【解决方案1】:
Set-ItemProperty iis:\Sites\swmarket -Name applicationpool -Value swmarket

或者,使用 Powershell 3,您可以这样做:

New-WebAppPool -Name $WebSiteName
New-Website -Name $WebSiteName -ApplicationPool $WebSiteName -HostHeader $WebSiteName -PhysicalPath $PathInfo -Port 80
Set-Content $PathInfo\default.htm “PSCreated Default Page”

查看 MS Technet 描述 here.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-04-12
    • 2015-05-12
    • 1970-01-01
    • 2014-09-25
    • 1970-01-01
    • 1970-01-01
    • 2021-10-14
    • 2013-12-04
    相关资源
    最近更新 更多