I need to disable a custom timer job when deactivating a feature and must run the timer job on activating the feature in SharePoint 2010. Can you please help me with the code or blogs or pointers.
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
Within your feature receiver you can set the SPJobDefinition property isDisabled to get/set whether it is enabled.
To run the job during activation you call the RunNow method.
Here is a link to the SPJobDefinition Members - http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spjobdefinition_members.aspx