Thursday 30 August 2018

SharePoint Timer jobs check


SharePoint Timer service was started in services.msc, the timer service instance object (this is a SharePoint farm object) may be set to “Disabled”. Use below script to get the status of all the timer instances in the farm.
---------------------------------------------------------------------------
 $farm = Get-SPFarm
 $FarmTimers = $farm.TimerService.Instances
 foreach ($FT in $FarmTimers)
 {
 write-host "Server: " $FT.Server.Name.ToString();
 write-host "Status: " $FT.status;
 write-host "Allow Service Jobs: " $FT.AllowServiceJobs;
 write-host "Allow Content DB Jobs: " $FT.AllowContentDatabaseJobs;"`n"
 }
 $disabledTimers = $farm.TimerService.Instances | where {$_.Status -ne "Online"}
 if ($disabledTimers -ne $null)
 {
 foreach ($timer in $disabledTimers)
 {
 Write-Host -ForegroundColor Red "Timer service instance on server " $timer.Server.Name " is NOT Online. Current status:" $timer.Status
 Write-Host -ForegroundColor Green "Attempting to set the status of the service instance to online..."
 $timer.Provision()
 $timer.Start()
 write-host -ForegroundColor Red "You MUST now go restart the SharePoint timer service on server " $FT.Server.Name}}
 else
 {
 Write-Host -ForegroundColor Green "All Timer Service Instances in the farm are online. No problems found!"
 }


3 comments:

  1. Do you know what cause the AllowServiceJobs to false? I set my server AllowServiceJobs= true but on the next day it become false again.

    ReplyDelete
  2. Same issue here. Did you manage to identify the root cause of this?

    ReplyDelete
    Replies
    1. Generally it happened due to server performance and server load issue. Also check if you have more servers then it might be server load request distribution issue. For safe side, try to maintain the Admin health reports while start the business and try to make it fix before any issue occurred. Thanks

      Delete