3

I am trying to activate a sharepoint feature in 2010. When I try to activate it I reaceive the "Access Denied" error message. I am an admin on the server and a site admin on the site I'm trying to activate the feature on. In the event viewer the following error shows up:

Log Name: Application Source: Microsoft-SharePoint Products-SharePoint Foundation Date: 1/30/2011 10:41:11 PM Event ID: 6615 Task Category: Runtime Level: Error Keywords:
User: mmurphy Computer: SPS1.xx.com Description: Access denied. Event Xml: 6615 14 2 10 0 0x4000000000000000 2364 Application SPS1.**.com Access denied.

Any ideas?

Thanks,

  • What does the feature do? – James Love Jan 31 '11 at 8:19
  • ...and does it have feature activation code? Also you should receive a correlation id when your activation fails, please check that id against the ULS trace log – Anders Rask Jan 31 '11 at 11:41
  • The features that are having the problem are trying to access the web.config file. As a work around, I commented that code out and manually updated the web.config. However, I would like to know what permissions are required in order to update the web.config file while deploying a feature? – mikemurf22 Feb 1 '11 at 19:05
5

In order to make modifications to the web.config you have to be a farm administrator. When you inspect the ULS log you will find a few lines above 'Access Denied' the message: "The SPPersistedObject, SPWebService, could not be updated because the current user is not a Farm Administrator"

When you ARE a farm administrator and still getting this message, running Paul's script can do the trick, you can find it here: http://unclepaul84.blogspot.com/2010/06/sppersistedobject-xxxxxxxxxxx-could-not.html

Please run the script from PowerShell. The script turns off remote administration security: Microsoft.SharePoint.Administration.SPWebService.ContentService.RemoteAdministratorAccessDenied

You have to be careful when manually editing the web.config file. The added keys are not stored in the database and when the web.config is built again from the database the keys can(read: will be) be gone. I experienced that myself unfortunately.

Regards, Anita

2

i am getting this same error but my feature does not modify the web.config file. I have also tried the script to turn off the remote admin setting and that also does not work. My .wsp is 3 projects that all depend on one another... a web application for accessing a remote url, a sharepoint project with code for a custom claims provider, and another SP project which is nothing more than a feature to implement the above-mentioned claims provider. If i deploy this as a farm solution, it deploys and activates automatically and works fine. If I deploy it as a site solution, it will deploy but throws this error during activation. Any ideas?

1

This is because of a new feature in SharePoint 2010, where it explicitly blocks any modification which is from SPPersistedObject in the Microsoft.SharePoint.Administration namespace. To avoid this we can write a piece of code to disable the same and enable it back after deploying the feature.

 SPWebService myService = SPWebService.ContentService;
 myService.RemoteAdministratorAccessDenied = false;
 myService.Update();
 //your code goes here
 myService.RemoteAdministratorAccessDenied = true;
 myService.Update(); 
  • just to note if your getting that warning already then you cannot set RemoteAdministratorAccessDenied as you still dont have access ;) nice try tho :) – Ali Jafer Nov 20 '13 at 11:02
0

pasting the content from the blogspot.in site ** **credit goes to Anita

"The SPPersistedObject, XXXXXXXXXXX, could not be updated because the current user is not a Farm Administrator" craziness in Sharepoint 2010 After upgrading from SharePoint 2007 to 2010 we noticed that our custom job scheduler web part started throwing the following error:

"The SPPersistedObject, Microsoft.SharePoint.Administration.SPJobDefinition, could not be updated because the current user is not a Farm Administrator".

Since we were running the SPJobDefinition.Update() and related code under SPSecurity.RunWithElevatedPrivileges() I was under the impression that the code already ran as Farm Admin. After banging my head against the wall for a couple hours with no solution I decided to whip out my most trusted tool - Red Gate's Reflector - it never failed me before. 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:

Microsoft.SharePoint.Administration.SPWebService.ContentService.RemoteAdministratorAccessDenied

After setting this property from PowerShell the issue went away with no code changes. The script I used is attached to this post.

    function Set-RemoteAdministratorAccessDenied-False()
    {
   [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") 
      > $null
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.
      SharePoint.Administration") > $null

     # get content web service
     $contentService = 
        [Microsoft.SharePoint.Administration.SPWebService]::ContentService
    # turn off remote administration security
    $contentService.RemoteAdministratorAccessDenied = $false
     $contentService.Update() 
       }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.