Thursday, January 22, 2015

Displaying List of Services running on each server on SharePoint Farm using PowerShell

Displaying List of Services running on each server on SharePoint Farm using PowerShell

foreach($server in $servers)
{
      $serverName = $server.DisplayName
      Write-Host $serverName -ForegroundColor "Black" -BackgroundColor "Yellow" 

      # Get SharePoint services running
      $servicesRunning = $server.ServiceInstances | Where{$_.Status –eq "Online" –and $_.Hidden –eq $False}
      Write-Host "SharePoint Services Running:" -ForegroundColor "Blue" -BackgroundColor "White"
      $servicesRunning | Select TypeName
      Write-Host "`n"
}


No comments:

Post a Comment