Tuesday, November 3, 2009

Feature activation for timer jobs

A SharePoint feature receiver based on timer job is created as a site collection feature and you try to activate the feature

May throw the error message “EXECUTE permission denied on object 'proc_putObject'.

This is because adding the timer job is done by the account that runs the application pool of your web application. This account normally does not have write / execute permissions in the configuration database.

The best way to get around this is to change the scope of your feature to WebApplication. In a few examples on the internet, the feature is Site scoped. If you change it to WebApplication scope, you have to activate the feature in the Central Administration. The application pool that runs that web application has enough permission to do this. Of course you need to slightly modify the code of your feature receiver. Instead of casting the properties.Feature.Parent to a SPSite, you cast it to a SPWebApplication.

http://www.tonstegeman.com/Blog/Lists/Posts/Post.aspx?List=70640fe5-28d9-464f-b1c9-91e07c8f7e47&ID=82

No comments:

Post a Comment