查看任意timer job的schedule

在文章强制执行MOSS的Timer Jobs中, 我们讨论了如何修改Timer Job的Schedule. 其中说起过, customized的timer job的schedule要修改, 必须经过Object Model. 那如果我只想看看这个timer job的schedule也不得不写一段代码才可以么?

 

答案是: 不.

 

虽然stsadm.exe不包括对自定义timer job的schedule属性的读取, 你却可以从数据库中直接捞取这个数据. 非自定义的timer job也适用.

 

比如说, 我们想查看名字叫Application Server Administration Service Timer Job的schedule.

1. 你可以从管理中心的timer job definition中看到timer job的确切名字.

2. 打开SQL management studio, 新建一个query.

 

3. 输入如下的查询语句:

select Properties from Objects (nolock) where Properties like '%Application Server Administration Service Timer Job%'

 

4.返回结果如下:

<object type="Microsoft.Office.Server.Administration.ApplicationServerAdministrationServiceJob, Microsoft.Office.Server, 
        Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
  <fld name="m_OriginatingServer" type="null" />
  <fld name="m_Server" type="null" />
  <fld type="Microsoft.SharePoint.Administration.SPJobLockType, Microsoft.SharePoint, Version=12.0.0.0, 
       Culture=neutral, PublicKeyToken=71e9bce111e9429c" name="m_LockType">None</fld>
  <sFld type="String" name="m_Recurrence">every 1 minutes between 0 and 59</sFld>
  <sFld type="DateTime" name="m_OneTimeOccurrence">0001-01-01T00:00:00</sFld>
  <sFld type="String" name="m_Title">Application Server Administration Service Timer Job</sFld>
  <sFld type="Int32" name="m_Flags">0</sFld>
  <fld type="System.Collections.Hashtable, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 
       name="m_UpgradedPersistedFields" />
  <fld name="m_Properties" type="null" />
  <sFld type="String" name="m_LastUpdatedUser">Domain\FarmAdmin</sFld>
  <sFld type="String" name="m_LastUpdatedProcess">psconfigui</sFld>
  <sFld type="String" name="m_LastUpdatedMachine">SpsServer01</sFld>
  <sFld type="DateTime" name="m_LastUpdatedTime">2010-01-12T17:43:43</sFld>
</object>

 

5. 注意其中的m_Recurrence, 其中描述的就是timer job的schedule了---“every 1 minutes between 0 and 59”

posted on 2010-03-11 13:23  中道学友  阅读(538)  评论(0编辑  收藏  举报

导航

技术追求准确,态度积极向上