다음을 통해 공유


SharePoint Server 2010: Timer Jobs not Functioning After Applying Updates

[ Updated 10/28/2011]: Changing the title of the post . This problem affects several areas of the product, not just profile synchronization

Overview

I recently came across a nasty case where the user profile synchronization service just won’t start. Additionally, the one-time timer jobs that are created as a result of certain administrative operations were not getting deleted.  The problem started happening after the SharePoint environment was patched and upgraded with a cumulative update.  It all boiled down to the timer service instance object on some of the servers being in an Offline state (even though the Windows Timer Service was started).  Here are the details of the problem and the solution:

Note: User Profile Synchronization service can fail to start in several different scenarios, this post talks about the scenario where the timer service instance object is left in an Offline state on one or more servers, which is likely to happen after an upgrade. The Power Shell commands provided in the article below can help you confirm whether or not you’re running into the problem of offline timer service instance.

The Timer Service Instance Object (SPTimerServiceInstance)

Every SharePoint server has one SPTimerServiceInstance object which basically represents the SPTimerV4 Windows Service. In certain circumstances (typically after an upgrade), you could end up in a situation where your timer service is running on the server but the SPTimerSericeInstance object is not Online. In this case, any administrative operations that depend on timer jobs to be completed  (such as starting the User Profile Synchronization Service) will not be successful.

Finding and Resolving the Problem

I have put together a PowerShell script that can be run on any SharePoint server in the farm. The script detects SPTimerServiceInstance objects in the farm that are not online, and attempts to update their status to Online.  After running the script, please manually restart the SPTimerV4 Windows Service (SharePoint 2010 Timer) on each server that is identified to have the problem.

$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"
}

Hope you find this useful!

Happy SharePointing!

Comments

  • Anonymous
    September 14, 2011
    Awesome, it worked like a charm for me, Thanks a lot Tehnoon.

  • Anonymous
    September 14, 2011
    Awesome, it worked like a charm for me, Thanks a lot Tehnoon.

  • Anonymous
    March 25, 2012
    Can we use :  $timer.Status = "Online" instead of :  $timer.Status = [Microsoft.SharePoint.Administration.SPObjectStatus]::Online

  • and still get the same result?
  • Anonymous
    July 16, 2012
    you cannot use $timer.Status = "Online" as it is  nto string its stype of Administration.SPObjectStatus enum you need to type cast

  • Anonymous
    December 10, 2013
    Say I have a server that went offline and I have 5 timer jobs stuck associated with that server.  How would I stop those Stuck running jobs?

  • Anonymous
    December 12, 2013
    awesome

  • Anonymous
    December 12, 2013
    Hi Chilly, If you have completely lost the server, you should go to the "Servers in Farm" page from central administration web site and remove the server from the farm. This should also remove the timer jobs.

  • Anonymous
    October 15, 2014
    Thank you! I ran into this very issue on one of my app servers after apply the September 2014 CU to my 2013 farm. The timer service appeared to be running under services but some of my jobs, like the nightly spproduct versioning job, wasn't running.

  • Anonymous
    November 26, 2014
    Thank you! Time service was running and I could even restart it, but no schedules jobs were running. You code did the job!

  • Anonymous
    January 12, 2015
    I had problems in SP2013 when updating the farm service account credentials, with the credentials not being pushed out to all application pools and services. This script fixed the problems. Thank you!

  • Anonymous
    February 15, 2017
    Thank You Tehnoon. It was a life saver. I owe you a dinner when you'll return Lahore.

  • Anonymous
    November 21, 2018
    Hi Tehnoon RazaThank you so much , I spent a long time to try to find a solution of my problem , my services applications (Excel services , BDC.. ) were stucking in creation and I was not able to do anything until finding your solution, you save me thank you a lot

  • Anonymous
    November 29, 2018
    Thanks for sharing Tehnoon. It worked for me and was able to resolve the issue.

  • Anonymous
    January 18, 2019
    Hi Tehnoon,Thank you so so so much , I spent a long time to try to find a solution of my problem , my User profile Service and User Profile Synchronization Service (SP2013) wouldn't start and endless in starting state.I tried everything and your solution did the trick. Thanks again so much!