Tuesday, October 29, 2013

Access denied when deploying a timer Job or activating a feature from SharePoint 2010

Issue: You might get access denied error message in event  log while activating timer job at site collection level

Cause: This is due to a new security feature implemented in SharePoint 2010. This feature explicitly blocks any modifications to the objects inheriting from SPPersistedObject in the Microsoft.SharePoint.

Resolution: Run below powershell script:
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()        
}

Set-RemoteAdministratorAccessDenied-False


Reference link: http://support.microsoft.com/kb/2564009