Collaboration-2-Go


Lösungen und Software-Entwicklung im Collaboration Umfeld, insbesondere Microsoft SharePoint, Microsoft Exchange und Microsoft Office.

Support


Mobil: +49 (152) 53 97 78 79
Mail: service@collaboration-2-go.de
Weitere Kontaktmöglichkeiten: Kontaktseite
Dekoration: Köln



Restart Worker Processes and SPTimerV4 in Farm
Created: 13.12.2014
Categories: PowerShell; SharePoint 2013

Restart IIS worker processes and SPTimerV4 in SharePoint Farm


add-pssnapin microsoft.sharepoint.powershell
$spserver = get-spserver | ?{$_.role -eq "Application"}
foreach ($server in $spserver)
{
  $name = [string]::concat("\\", $server.name)
  write-host "Performing IIS Reset on Server:"$server.name
  iisreset $server.Name

  write-host "Stopping SPTimerV4 on Server:"$server.name
  $stat = sc.exe $name stop sptimerv4
  $stat = sc.exe $name query sptimerv4
  while ($stat -match "STOP_PENDING")
  {
    write-host "Stopping"
    $stat = sc.exe $name query sptimerv4
    start-sleep 4
  }

  write-host "Starting SPTimerV4 on Server:"$server.name
  $stat = sc.exe $name start sptimerv4
  $stat = sc.exe $name query sptimerv4
  while (-not $stat -match "RUNNING")
  {
    write-host "Starting"
    $stat = sc.exe $name query sptimerv4
    start-sleep 4
  }

  write-host "SPTimerV4 started on Server:"$server.name
}

    

Send us a Comment!