SharePoint Farm Reboot


Below script will help you to reboot all servers in SharePoint Farm.


asnp "*sharepoint*"

$servers = Get-SPServer | ?{$_.Role -ne "Invalid"}


foreach ($server in $servers)
  {
    $servername = $server.Address

    Write-output "Executing on : $server" -ForegroundColor Yellow

    if($env:COMPUTERNAME -ne $servername)
    {
Write-output $servername
 
SHUTDOWN /r /f /t 0 /m \\$servername 
    }

  }

  SHUTDOWN /r /f /t 0 /m \\$env:COMPUTERNAME

Comments

Popular posts from this blog

[Solved ] ...The product key entered does not match any of the Windows images available for installation. Enter a different product key

SharePoint Search Service application content sources showing Paused

User Profile Synchronization Service Struck on "Starting" - Fixed