简体   繁体   English

如何启动仅针对使用 Powershell 处于“已启动”状态的网站而停止的 IIS 应用程序池?

[英]How to start IIS application pools which are stopped only for websites which has "Started" status using Powershell?

does anyone can point me direction how I can start IIS (7/8) application pools which are stopped only for websites which has "Started" status using Powershell (so no starting app pool for their connected application/websites which has Stopped state)?有没有人可以指点我如何启动 IIS (7/8) 应用程序池,这些应用程序池仅针对使用 Powershell 处于“已启动”状态的网站停止(因此,对于已停止状态的已连接应用程序/网站,没有启动应用程序池)?

Scenario1: Stopped app pool Started website场景 1:停止的应用程序池启动的网站

START app pool启动应用程序池

Scenario2: Stopped app pool Stopped website场景 2:停止的应用程序池停止的网站

DO NOTHING没做什么

Thanks谢谢

I don't understand the downvotes too.我也不明白downvotes。 However, you can try this:不过,你可以试试这个:

Import-Module WebAdministration

gci IIS:\Sites |
     where state -eq 'Started' | 
     select -ExpandProperty applicationPool | 
     % { Start-WebAppPool $_ }

It seems like you don't have to check whether the applicationPool is already started, but you can adopt the script and check the status using the Get-WebAppPoolState cmdlet if you think its necessary.似乎您不必检查 applicationPool 是否已启动,但如果您认为有必要,您可以采用该脚本并使用Get-WebAppPoolState cmdlet 检查状态。

暂无
暂无

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

相关问题 如何使用Powershell在远程服务器上运行IIS应用程序池列表? - how to operate On List of IIS Application Pools On Remote Server Using Powershell? 使用PowerShell或其他脚本自动配置IIS网站/应用程序池 - Auto configuring IIS websites / app pools using PowerShell or other scripts 从C#运行的PowerShell启动/停止IIS应用程序池无效 - PowerShell run from C# to start/stop IIS application pools has no effect 如何使用PowerShell在IIS中停止和启动各个网站? - How can I stop and start individual websites in IIS using PowerShell? 如何使用PowerShell确保服务已停止或启动? - How to ensure that service has been stopped or started using PowerShell? 如何以交互方式启动之前停止的 docker Powershell 容器 - How to start a docker Powershell container interactively which was stopped before 如何使用PowerShell从远程计算机获取所有(IIS)网站状态/状态? - How to get all (IIS) websites status/state from remote machine using PowerShell? Powershell命令导出远程服务器的IIS网站和应用程序池 - Powershell command to export IIS websites and app pools of a remote server 如何使用powershell脚本启动和停止IIS中的应用程序池 - How to start and stop application pool in IIS using powershell script 我可以使用Powershell在远程IIS服务器上创建站点和应用程序池吗? - Can I create sites and application pools on a remote IIS server using Powershell?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM