SharePoint 2010 开发遇到Access denied user is not a Farm Administrator

 

执行如下 Poweshell 的脚本

 

 

$contentService =[Microsoft.SharePoint.Administration.SPWebService]::ContentService
$contentService
.RemoteAdministratorAccessDenied=
$false
$contentService
.Update()
 
 
 
具体解释请参考下面的KB 文章
 
 

 

 

RemoteAdministratorAccessDenied is a persisted property which can be set to false to disable the feature. You can do this either in a Console app or use Powershell and then perform an IISReset.

//Console app code

SPWebService myService = SPWebService.ContentService; 
myService.RemoteAdministratorAccessDenied = false; 
myService.Update(); 


//PowerShell code

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

你可能感兴趣的:(SharePoint)