How to remotely stop/start an application pool in IIS 8

后端 未结 2 1049
小蘑菇
小蘑菇 2021-02-01 17:54

Caveat: using one line each!

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

Start:

(get-wmiobject -namespace          


        
2条回答
  •  借酒劲吻你
    2021-02-01 18:27

    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" }
    

提交回复
热议问题