本文介绍了如何在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中远程停止/启动应用程序池
发布评论