How to get Timer Job History
1. Get Timer Job internal name with id.
Job ID can be 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, you can get the history of specific Timer Job

The result will be 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 *.rtf
if($FindRTFFile)
{
foreach($file in $FindRTFFile)
{
remove-item $file
}
}
start-transcript $logfile
Function TimerJobReport()
{
$Output = $scriptBase + "\" + "TimerJobReport.csv";
"Name" + "," + "Status" + "," + "LastRun" + "," + "Schedule" | Out-File -Encoding Default -FilePath $Output;
write-host "Generating TimerJob generic report" -fore yellow
$TimerJobs = get-sptimerjob
foreach($TimerJob in $Timerjobs)
{
$TimerJob.name + "," + $TimerJob.status + "," + $TimerJob.lastruntime + "," + $TimerJob.schedule | Out-File -Encoding Default -Append -FilePath $Output;
}
write-host "TimerJob genric report collected and placed under " $Output -fore green
} Function TimerJobHistory()
{
$Output1 = $scriptBase + "\" + "TimerJobHistoryReport.csv";
"Name" + "," + "Status" + "," + "ServerName" + "," + "WebApplicationName" + "," + "ErrorMessage" | Out-File -Encoding Default -FilePath $Output1;
write-host "Generating TimerJob history report" -fore yellow
$TimerJobs = get-sptimerjob
foreach($TimerJob in $Timerjobs)
{
$JobHistories = $TimerJob.historyentries
foreach($Jobhistory in $JobHistories)
{
if($TimerJob.lastruntime.ToUniversalTime() -eq $JobHistory.starttime)
{
$TimerJob.Name + "," + $Jobhistory.status + "," + $Jobhistory.servername + "," + $Jobhistory.WebApplicationName + "," + $Jobhistory.ErrorMessage | Out-File -Encoding Default -Append -FilePath $Output1;
}
}
}
write-host "TimerJob history report generated and placed under " $output1 -fore green
} Function SpecificTimerJob()
{
$Output2 = $scriptBase + "\" + "SpecificTimerJobHistoryReport.csv";
"Name" + "," + "Status" + "," + "ServerName" + "," + "TimerJobStartTime" + "," + "WebApplicationName" + "," + "ErrorMessage" | Out-File -Encoding Default -FilePath $Output2;
$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 that you 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 -Encoding Default -Append -FilePath $Output2;
}
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 Timer Job History的更多相关文章
- 如何收缩超大的SharePoint_Config数据库
前言 在已经运行了2年多的SharePoint服务器上,发现SharePoint_Config的数据库文件越来越大,已经达到90几个GB,收缩可以减小20几个GB,但是一周以后又会恢复到90几个GB大 ...
- 怎样收缩超大的SharePoint_Config数据库
前言 在已经执行了2年多的SharePointserver上,发现SharePoint_Config的数据库文件越来越大,已经达到90几个GB,收缩能够减小20几个GB,可是一周以后又会恢复到90几个 ...
- Azure WebJob-Custom Schedule for Azure Web Job Timer Triggers
如果想实现Azure Schedule WebJob,有两种方法: 1. 配置CRON Expression,网上有在线CRON配置工具,根据业务需要配置即可 注意:Azure的CRON Expres ...
- JavaScript(JS)之Javascript对象BOM,History,Location,Function...(二)
https://www.cnblogs.com/haiyan123/p/7594046.html 在JavaScript中除了null和undefined以外其他的数据类型都被定义成了对象,也可以用创 ...
- JS BOM基础 全局对象 window location history screen navigator
全局变量声明的两种方式:1,window.变量名=值;2,var 变量名=值; 全局函数声明的两种方式:1,window.函数名=function(){}2,function 函数名=function ...
- History API与浏览器历史堆栈管理
移动端开发在某些场景中有着特殊需求,如为了提高用户体验和加快响应速度,常常在部分工程采用SPA架构.传统的单页应用基于url的hash值进行路由,这种实现不存在兼容性问题,但是缺点也有--针对不支持o ...
- 使用backbone的history管理SPA应用的url
本文介绍如何使用backbone的history模块实现SPA应用里面的URL管理.SPA应用的核心在于使用无刷新的方式更改url,从而引发页面内容的改变.从实现上来看,url的管理和页面内容的管理是 ...
- 使用h5的history改善ajax列表请求体验
信息比较丰富的网站通常会以分页显示,在点“下一页”时,很多网站都采用了动态请求的方式,避免页面刷新.虽然大家都是ajax,但是从一些小的细节还是 可以区分优劣.一个小的细节是能否支持浏览器“后退”和“ ...
- HTML5学习笔记之History API
这系列文章主要是学习Html5相关的知识点,以学习API知识点为入口,由浅入深的引入实例,让大家一步一步的体会"h5"能够做什么,以及在实际项目中如何去合理的运用达到使用自如,完美 ...
随机推荐
- 链接(extern、static关键词\头文件\静态库\共享库)
原文链接:http://www.orlion.ga/781/ 一. 多目标文件的链接 假设有两个文件:stack.c: /* stack.c */ char stack[512]; int top = ...
- javascript运动系列第二篇——变速运动
× 目录 [1]准备工作 [2]加速运动 [3]重力运动[4]减速运动[5]缓冲运动[6]加减速运动[7]往复运动[8]变速函数 前面的话 前面介绍过匀速运动的实现及注意事项,本文在匀速运动的基础上, ...
- 深入学习jQuery动画控制
× 目录 [1]动画状态 [2]停止动画 [3]动画延迟[4]全局控制 前面的话 jQuery动画可以使用fade.hide.slide等方法实现基本动画效果,可以使用animate实现自定义动画,甚 ...
- .Net 转战 Android 4.4 日常笔记(3)--目录结构分析
看了创建项目后,出现的文件夹很多确实有点晕,不过经过简单的了解还是跟我们asp.net的目录有点相识滴. 下面这张图,概括了主要的文件用途.其实也只需要了解这几个就差不多了,知道在那里设计界面,那里写 ...
- jQuery UI Datepicker使用介绍
本博客使用Markdown编辑器编写 在企业级web开发过程中,日历控件和图表控件是使用最多的2中第三方组件.jQuery UI带的Datepicker,日历控件能满足大多数场景开发需要.本文就主要讨 ...
- JavaSE高级之集合类
下面的内容是对java中的集合类进行的总结,过段时间会分享java的网路编程,多线程等内容,欢迎批评指正. 1.Java中的集合是用来存放对象的,即集合是对象的集合,对象是集合的元素,java AP ...
- 谈谈JIT编译器和本机影像生成器(NGen.exe)
前言 在看<CLR>的时候,作者在开篇的时候提到了NGen.exe,前面一节执行程序集的代码中提到:程序或方法执行前会执行MSCorEE.dll中的JIT函数把要执行方法的IL转换成本地的 ...
- [c++] Templates
Template是编译时多态.所有的模板都是在编译时产生对应的代码,它没有面向对象中的虚表,无法实现动态多态. Function Template A function template is a p ...
- Java:IDEA下使用JUNIT
JUnit单元测试--IntelliJ IDEA (本文转载自华行天下) 单元测试的基本使用 一.环境配置 使用idea IDE 进行单元测试,首先需要安装JUnit 插件. 1.安装JUnit插件步 ...
- Oracle 11g 编译使用BBED
环境:RHEL 6.4 + Oracle 11.2.0.4 1. 拷贝缺失文件 2. 编译BBED 3. BBED使用测试 Reference 1. 拷贝缺失文件 11g中缺失几个相关文件,但我们实际 ...