How To start/stop IIS 6.0/7.0 remotely using PowerShell Scripts?

后端 未结 6 2631
一向
一向 2021-02-20 04:42

I have two servers Server A and Server B. I want to stop server A from Server B remotely using Powershell script.

6条回答
  •  独厮守ぢ
    2021-02-20 04:56

    Option 1:

    iisreset remotepcname /restart
    

    Option 2:

    (Get-Service -ComputerName remotepc -Name 'IISAdmin').stop()
    

    Option 3:

    Invoke-Command -ComputerName remotepc -ScriptBlock {iisreset}
    

提交回复
热议问题