Restart IIS on remote machine

后端 未结 6 1833
别那么骄傲
别那么骄傲 2020-12-23 20:43

How can restart IIS on a remote machine?

I know the IP address and administrator user\'s user name and password information.

I am using C#

6条回答
  •  余生分开走
    2020-12-23 21:16

    The following POSH script will allow you to asynchronously reset a set of machines remotely (very handy when working with a large set):

    $a = Get-Content "c:\OneMachineNamePerLine.txt"
    
    foreach($line in $a)
    {
    
        Start-Job -ScriptBlock {
            iisreset $line
        }
    }
    

提交回复
热议问题