Timer Job History Timer Job History
Alexis Daniel

Alexis Daniel

November 24, 2012

All Post
Timer Job History
Share:

Timer Job History

SharePoint maintains a timer job history by default for seven days. You can see the current duration:

$TJ = Get-SPTimerJob | Where-Object {$_.name -eq "job-delete-job-history"}
$TJ.daystokeephistory

If you’d like to know when the job last ran just run:

$TJ.get_LastRunTime()

If you want to reduce the days to retain history, here’s how:

  $TJ.set_DaysToKeepHistory(3)
  $TJ.update()

I suggest changing the cleanup frequency to run daily, to reduce periodic growth.

Occasionally the Timer Job History grows to the point where it needs to be gradually cleaned. You can use the technique I outline in this article to gradually cull the timer job history:
sync db grows indefinitely

 

You can also review Timer Job history via SQL against the farm DB:

 SELECT TOP 1000
[Status]
 ,[StartTime]
 ,[EndTime]
 ,[WebApplicationName]
 ,[JobTitle]
 ,[ServerName]
 ,[DatabaseName]
 ,[ErrorMessage]
 FROM [SharePoint_2013_Farm].[dbo].[TimerJobHistory]
 
 where CHARINDEX('text you know is in the job name',JobTitle) > 0

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to talk?

Drop us a line. We are here to answer your questions 24*7.