Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Created February 21, 2015 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpsmith/5f5db8378c303da87bc4 to your computer and use it in GitHub Desktop.
Save wpsmith/5f5db8378c303da87bc4 to your computer and use it in GitHub Desktop.
PowerShell: Get SharePoint Timer service instances on the server and whether they are online.
$farm = Get-SPFarm
$disabledTimers = $farm.TimerService.Instances | where {$_.Status -ne "Online"}
if ($disabledTimers -ne $null)
{
foreach ($timer in $disabledTimers)
{
Write-Host "Timer service instance on server " $timer.Server.Name " is not Online. Current status:" $timer.Status
Write-Host "Attempting to set the status of the service instance to online"
$timer.Status = [Microsoft.SharePoint.Administration.SPObjectStatus]::Online
$timer.Update()
}
}
else
{
Write-Host "All Timer Service Instances in the farm are online! No problems found"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment