Custom Timer Job in SharePoint 2010



Introduction:

In this article we will be seeing how to create a custom timer job in SharePoint 2010 using Visual Studio 2010. A timer job runs in a specific Windows service for SharePoint Server and performs infrastructure tasks for the Timer service, such as clearing the timer job history and recycling the Timer service; and tasks for Web applications, such as sending e-mail alerts. A timer job contains a definition of the service to run and specifies how frequently the service is started. The SharePoint 2010 Timer service (SPTimerv4) runs timer jobs.

In this article we will be performing the following steps

  1. Creating a custom timer job.

  2. Deploying the timer job.

  3. Registering the timer job

  4. Managing configuration data for timer jobs.


Solution Overview: 


I have a web application => Site Collection =>3 Subsites as shown in the above diagram. Each subsite has a custom list – "Projects" which has the following columns and values

LN subsite:

Java subsite:

SharePoint subsite:

"Test" site collection has a list called "Completed Projects" which will have all the completed projects from all the subsites as