Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

My solution contains Site Collection scope features and has been deployed to Site Collections that the farm administrator has not been granted any explicit permissions.

If the farm administrator tries to visit the site collection in the browser he sees an Access Denied error message.

The farm admin now needs to deploy an upgrade to my Solution.

He has successfully called the powershell cmdlet Update-SPSolution

when the farm admin calls SPContentDatabase.QueryFeatures("Site",$true) it returns the feature that needs to be upgraded in the site that he has no permissions to access.

However if the farm admin calls SPFeature.Upgrade($true) then an access denied error is thrown.

How is the site collection feature upgrade supposed to work?

Should the farm admin delegate site collection feature upgrade to the site collection owner?

Should the farm admin try to impersonate the site collection administrator?

Is there some user I can elevate to that is guaranteed to be able to call Upgrade on a site collection feature?

share|improve this question
    
I found this link. social.technet.microsoft.com/Forums/en-GB/sharepointadmin/… It suggests to "take ownership" of the site collection. But this doesn't feel right to me. –  Steve P Oct 20 '10 at 17:37
    
We found a way to elevate privileges enough that we can upgrade features in the site. I'm still not sure if we should elevate or delegate to the site collection admin. I'll leave it another week and see which answer gets the most votes. –  Steve P Oct 24 '10 at 12:49

2 Answers 2

Farm Administrators do not by default have access to Site content.

Site collection feature upgrade and activation is normally delegated to the Site Collection Administrators (I think).

share|improve this answer
    
Is there some UI the Site Collection admin can use to upgrade the features? –  Steve P Oct 20 '10 at 17:36
1  
Unsure, but have a look at Chris O'Brien's SPFeatureUpgrade Kit on Codeplex: spfeatureupgrade.codeplex.com –  James Love Oct 20 '10 at 18:25
    
I wish I could double plus up vote thanks for the link. –  Steve P Oct 20 '10 at 18:36
    
No worries :) Could mark as Answer so others may find an answer to similar question they have. –  James Love Oct 20 '10 at 19:21
up vote 1 down vote accepted

We found that by using PowerShell code like this

[Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges( {
    $site = get-spsite "http://localhost/nonfarmadminsitecollection"
})
$elevatedSite = new-object Microsoft.SharePoint.SPSite([Guid]$site.ID,$site.SystemAccount.UserToken)

We are then able to upgrade the features in $elevatedSite.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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