1. Get Timer JOB internal name with ID.
Job ID can is found in SharePoint CA.
Below PowerShell can help you retrieve all jobs ' Internal Name by keywords.
Get-sptimerjob | Sort-object name | where {$_. Name-like "*profile*"} | FT id,name
2. Using script in attachment, can get to the history of specific Timer Job
The result would be a like this.
PowerShell
$LogTime= Get-date-format yyyy-mm-dd_hh-mm$LogFile=". \timerjobreportpatch-$LogTime. rtf" #Add SharePoint PowerShell Snapin if((Get-pssnapin-name microsoft.sharepoint.powershell-erroraction silentlycontinue)-eq $null) {Add-PSSnapin Microsoft.SharePoint.Powershell}$scriptBase= Split-path$SCRIPT: Myinvocation. Mycommand.path-Parent Set-location$scriptBase #Deleting any. rtf files in the scriptbase location$FindRTFFile= Get-childitem$scriptBase\*.*-include *. rtfif($FindRTFFile) { foreach($file inch $FindRTFFile) {Remove-item$file}} Start-transcript$logfile FunctionTimerjobreport () {$Output=$scriptBase+"\"+"Timerjobreport.csv"; "Name"+","+"Status"+","+"Lastrun"+","+"Schedule"| Out-file-encodingDefault-filepath$Output; Write-host"generating timerjob Generic report"-Fore Yellow$TimerJobs= get-SPTimerJobforeach($TimerJob inch $Timerjobs) { $TimerJob. Name +","+$TimerJob. Status +","+$TimerJob. LastRunTime +","+$TimerJob. Schedule | Out-file-encodingDefault-append-filepath$Output; } Write-host"timerjob genric Report collected and placed under" $Output-Fore Green}Functiontimerjobhistory () {$Output 1=$scriptBase+"\"+"Timerjobhistoryreport.csv"; "Name"+","+"Status"+","+"ServerName"+","+"WebApplicationName"+","+"errormessage"| Out-file-encodingDefault-filepath$Output 1; Write-host"Generating timerjob History Report"-Fore Yellow$TimerJobs= get-SPTimerJobforeach($TimerJob inch $Timerjobs) { $JobHistories=$TimerJob. Historyentriesforeach($Jobhistory inch $JobHistories) { if($TimerJob. LastRunTime. ToUniversalTime ()-eq $JobHistory. StartTime) { $TimerJob. Name +","+$Jobhistory. Status +","+$Jobhistory. ServerName +","+$Jobhistory. WebApplicationName +","+$Jobhistory. errormessage | Out-file-encodingDefault-append-filepath$Output 1; } }} write-host"timerjob History Report generated and placed under" $output 1-Fore Green}FunctionSpecifictimerjob () {$Output 2=$scriptBase+"\"+"Specifictimerjobhistoryreport.csv"; "Name"+","+"Status"+","+"ServerName"+","+"Timerjobstarttime"+","+"WebApplicationName"+","+"errormessage"| Out-file-encodingDefault-filepath$Output 2; $TimerJobName= Read-host"Enter the timer job name" $Timerjob= Get-sptimerjob-identity$TimerJobName $jobHistories= @($timerjob. Historyentries)$HowManyHistory= Read-host"Please enter the number of histories so want to return for this timerjob" for($i= 0;$i -le $HowManyHistory;$i++) { $TimerJob. Name +","+$jobHistories[$i].status +","+$jobHistories[$i].servername +","+$jobHistories[$i]. StartTime +","+$jobHistories[$i]. WebApplicationName +","+$jobHistories[$i]. errormessage | Out-file-encodingDefault-append-filepath$Output 2; } Break; } Write-host"########################################################################################################"-Fore Cyan Write-host"Enter 1 to get SP Timer job generic reports"-Fore Green Write-host"Enter 2 to get specific SP Timer job Report"-Fore Green Write-host"########################################################################################################"-Fore Cyan$option= Read-host"Enter the option" Switch($option) { 1{timerjobreport Timerjobhistory}2{Specifictimerjob}} write-host"SCRIPT completed"-Fore Green Stop-transcript
How to get the Timer Job history