Monday 9 June 2014

How many types of SharePoint timer job lock types are available?


Ans)Quick Answer is: 3
In SharePoint Timer jobs there is property called: SPJobLockType
Which will take 3 types of inputs.
Job, None, and ContentDatabase.
Job: means the job runs only once per farm per iteration. Ex: Password Management job, CEIP data collection job, and the Delete Job History job
To get all farm scoped jobs.
Get-SPTimerJob | ? {$_.LockType -eq "Job"}
None:means the job runs once per server. Ex: Config Refresh job, Timer Recycle job, and the Timer Locks job
Get-SPTimerJob | ? {$_.LockType -eq "None"}
ContentDatabase:means the job runs once for each content database. Ex:Content Database jobs are the Expiration and Hold Processing jobs, the Immediate Alerts jobs,
Audit Log Trimming job, and Recycle Bin cleanup job.
Get-SPTimerJob | ? {$_.LockType -eq "ContentDatabase"} | Select-Object -Unique | Sort-Object Name | Format-Table Name
The reason None is an appropriate description for a server-specific lock.
If your server runs with one Timer Service Instance per server. Means, When each timer service instance runs a job without checking or taking any locks, the result is
that the job is run once per server. So "no lock" or None is the logical equivalent of a per-server lock.