Creating a timer job to ensure the site branding feature is activated

SharePoint provides a framework for tasks that can be executed at scheduled intervals called SharePoint timer jobs. These timer jobs, when configured, are executed by the SharePoint Timer Windows service. In a large site with a lot of contributors, there may be the need to enforce some rules in the environment in a more automated fashion, such as using consistent branding. In this recipe, we will create a timer job that ensures the site branding feature is activated on all sites in the site collection.

How to do it...

Follow these steps to create a timer job:

  1. From the Solution Explorer pane, right-click on the project name.
  2. Select Add and then select Class.
  3. Provide a name for the ...

Get SharePoint 2013 WCM Advanced Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.