Sunday, May 11, 2014

New Farm Administrator - could not be updated because the current user is not a farm administrator

You might have come across situations where a new farm administrator via the Central Admin, but the granted rights to the user account does not work as you expected.

In SharePoint 2010, even though a user is added as farm administrator, you might get an error in the log as "could not be updated because the current user is not a farm administrator".

This is due to the ShrarePoint 2010 security feature, which blocks modifications to any object inheriting from SPPersistedObject in the Microsoft.SharePoint.Administration namespace.

To resolve this issue, run the below script in powershell, which grants access.


function RemoteAdministrator-GiveAccess()                                                                                                
{                                                                                                                                                                 
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null                              
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration") > $null       
                                                                                                                                                                   
    $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService                        
    $contentService.RemoteAdministratorAccessDenied = $false                                                                   
    $contentService.Update()                                                                                                                        
}                                                                                                                                                                 
                                                                                                                                                                   
RemoteAdministrator-GiveAccess       




                                                                                                        

Saturday, May 10, 2014

Error occurred in deployment step retract solution cannot start service SPUserCodeV4 - SP2010 Foundation

Developers might come across an error in Visual Studio where deployments fails with the error

"error occurred in deployment step retract solution cannot start service SPUserCodeV4 on computer .."

To resolve this issue in SharePoint foundation, follow the below steps:

1) Go to Central Administration
2) Click on "System Settings"
3) Click "Manage Services on Server"
4) The service "Microsoft SharePoint Foundation Sandboxed Code Service" might be stopped. Start it.