Custom SPJobDefinition and “Access denied” error

By | 2010-08-02

If you create a custom SPJobDefinition and use a Feature Event Receiver to deploy and install this (Timer) SPJobDefinition you receive an error when you call the Update() method:

“Access Denied”

How to code and install a SPJobDefinition

Paul Kotlyar found this on the subject:

“Upon detailed investigation of Microsoft.SharePoint.dll  I discovered that SharePoint guys added a new security feature to all objects inheriting from SPPersistedObject in the Microsoft.SharePoint.Administration namespace. This feature explicitly disallows modification of the above stated objects from content web applications, which is where our web part is running. The error message thrown is therefore very misleading. After some more tracing through the code I found a property in SharePoint API which controls this behavior: SPWebService.ContentService.RemoteAdministratorAccessDenied

Here is how to fix this Access Denied (through powershell):

2 thoughts on “Custom SPJobDefinition and “Access denied” error

  1. Pingback: Custom SPJobDefinition and “Access denied” error | SharePoint Blues

Leave a Reply

Your email address will not be published. Required fields are marked *