Adding Properties to Timer Jobs

April 13, 2012

Adding properties to timer jobs could be handy if you want to set the reference to a particular site collection, or if you want to set some parameters that are needed to run the job.

You could add these properties just like you would add properties to a SharePoint site.

The following code can be used to add a property to the timer job at the creation process.

To read the property in the timer job, you could use the following code.

Most of the time I use these properties to specify the site collection for which the timer job needs to run, or define a value for querying items.

Comments