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的更多相关文章

  1. 如何收缩超大的SharePoint_Config数据库

    前言 在已经运行了2年多的SharePoint服务器上,发现SharePoint_Config的数据库文件越来越大,已经达到90几个GB,收缩可以减小20几个GB,但是一周以后又会恢复到90几个GB大 ...

  2. 怎样收缩超大的SharePoint_Config数据库

    前言 在已经执行了2年多的SharePointserver上,发现SharePoint_Config的数据库文件越来越大,已经达到90几个GB,收缩能够减小20几个GB,可是一周以后又会恢复到90几个 ...

  3. Azure WebJob-Custom Schedule for Azure Web Job Timer Triggers

    如果想实现Azure Schedule WebJob,有两种方法: 1. 配置CRON Expression,网上有在线CRON配置工具,根据业务需要配置即可 注意:Azure的CRON Expres ...

  4. JavaScript(JS)之Javascript对象BOM,History,Location,Function...(二)

    https://www.cnblogs.com/haiyan123/p/7594046.html 在JavaScript中除了null和undefined以外其他的数据类型都被定义成了对象,也可以用创 ...

  5. JS BOM基础 全局对象 window location history screen navigator

    全局变量声明的两种方式:1,window.变量名=值;2,var 变量名=值; 全局函数声明的两种方式:1,window.函数名=function(){}2,function 函数名=function ...

  6. History API与浏览器历史堆栈管理

    移动端开发在某些场景中有着特殊需求,如为了提高用户体验和加快响应速度,常常在部分工程采用SPA架构.传统的单页应用基于url的hash值进行路由,这种实现不存在兼容性问题,但是缺点也有--针对不支持o ...

  7. 使用backbone的history管理SPA应用的url

    本文介绍如何使用backbone的history模块实现SPA应用里面的URL管理.SPA应用的核心在于使用无刷新的方式更改url,从而引发页面内容的改变.从实现上来看,url的管理和页面内容的管理是 ...

  8. 使用h5的history改善ajax列表请求体验

    信息比较丰富的网站通常会以分页显示,在点“下一页”时,很多网站都采用了动态请求的方式,避免页面刷新.虽然大家都是ajax,但是从一些小的细节还是 可以区分优劣.一个小的细节是能否支持浏览器“后退”和“ ...

  9. HTML5学习笔记之History API

    这系列文章主要是学习Html5相关的知识点,以学习API知识点为入口,由浅入深的引入实例,让大家一步一步的体会"h5"能够做什么,以及在实际项目中如何去合理的运用达到使用自如,完美 ...

随机推荐

  1. Create Volume 操作(Part II) - 每天5分钟玩转 OpenStack(51)

    上一节我们讨论了 Cinder 创建 Volume 的第一部分,cinder-api 的操作,本节继续第二部分,cinder-scheduler 调度工作. cinder-scheduler 执行调度 ...

  2. AngularJS之ng-class(十一)

    前言 本节我们来讲讲指令中的ng-class,通过添加ng-class来生成对应的样式,有时候得根据不同的条件来选择对应的样式,本节我们来看看ng-class的灵活性用法. ng-class使用字符串 ...

  3. 学习总结之 WebApi 用户登录和匿名登录,及权限验证

    近些天,看了一些博客园大牛关于webApi项目的的文章,也有请教师兄一些问题,自己做了个Demo试了试,收获甚多.感谢感谢,下面是我一些学习的总结,如若有错的地方请多多指教!! WebApi登陆与身份 ...

  4. 如何获取byte的各个bit值以及常见位操作

    项目中通过信号采集板的数据获取车上仪表盘指示灯的信息,将接收到的数据转成byte后,还要将每一个Byte的各个Bit值分离出来,这样才知道每个bit的值代表的具体信息.这里记录下如何获取byte的各个 ...

  5. 1Z0-053 争议题目解析541

    1Z0-053 争议题目解析541 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 541.If you use ALTER DISKGROUP ... ADD DISK and s ...

  6. 1Z0-053 争议题目解析683

    1Z0-053 争议题目解析683 考试科目:1Z0-053 题库版本:V13.02 题库中原题为: 683.Your production database it functional on the ...

  7. 探秘Tomcat——连接篇

    前两篇我们分别粗线条和细粒度的讲解了tomcat的服务是如何启动以及连接器Connector和容器Container又分别是如何被启动的. 本篇我们主要侧重tomcat中server.service以 ...

  8. iOS_UIImage的方向(imageOrientation)

    Demo下载地址 一.重现问题: 拍照获得的图片,由于尺寸不对,需要拆切.但是有的图片拆切出来,方向就乱了.查找了一些质量才知道.图片还有个方向属性! imageOrientation. 二.一个图片 ...

  9. WebGIS开源方案中空间数据的入库、编辑、发布的操作流程

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/. 1.前言 本开源方案的构架是:geoserver(服务器)+tomca ...

  10. 在本地测试一次成功的AJAX请求

    要在本地测试AJAX,首先是环境的搭建,下面以wamp为例. 1.先在wamp的官网下载wamp的安装包,网址 http://www.wampserver.com/. 2.安装wamp.如果安装过程中 ...