如何在IIS 8中远程停止/启动应用程序池

编程入门 行业动态 更新时间:2024-10-11 09:23:01
本文介绍了如何在IIS 8中远程停止/启动应用程序池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

警告:每个使用一行!

我在IIS 6中使用了这些命令,它们工作得很好。

I had these commands for use in IIS 6, and they worked just fine.

开始:

(get-wmiobject -namespace 'root\MicrosoftIISv2' -computername 'REMOTE_SERVER' -class 'IIsApplicationPool' | where-object {$_.Name -eq 'W3SVC/AppPools/MY_FANCY_APPPOOL'}).InvokeMethod('Stop', $null)"

- 和 -

停止:

(get-wmiobject -namespace 'root\MicrosoftIISv2' -computername 'REMOTE_SERVER' -class 'IIsApplicationPool' | where-object {$_.Name -eq 'W3SVC/AppPools/MY_FANCY_APPPOOL'}).InvokeMethod('Start', $null)

我正在寻找IIS 8中的替代方案。我需要一些单行,并且必须是Powershell命令。我通过 InvokePowerShellCommand调用它们 TFS中的活动。那里有没有人谁可以帮助我?

I'm looking for an alternative in IIS 8. I need a couple of one-liners and they must be Powershell commands. I'm invoking them via a InvokePowerShellCommand activity in TFS. Is there anyone out there who can help me out?

推荐答案

您可以执行以下操作来启动应用程序池:

You can do the following to start your application pool :

Invoke-Command -ComputerName "REMOTE_SERVER" -ScriptBlock { Start-WebAppPool -Name "MY_FANCY_APPPOOL" }

您可以执行以下操作来停止应用程序池:

You can do the following to stop your application pool :

Invoke-Command -ComputerName "REMOTE_SERVER" -ScriptBlock { Stop-WebAppPool -Name "MY_FANCY_APPPOOL" }

更多推荐

如何在IIS 8中远程停止/启动应用程序池

本文发布于:2023-11-25 20:28:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631236.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   如何在   IIS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!