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

I'm trying to do a test deployment to a client server.

The site collection backup completed without error.

When trying to add a spsolution I get an 'Access Denied' error. I'm adding it with the following:

Add-SPSolution -LiteralPath C:\webpartgallery.wsp

I'm a farm admin, site collection admin, and a shell admin. I'm NOT an administrator on the server, so I can't run powershell as an admin.

Is this a necessity, or is there something I'm missing?

Thanks.

Edit

I had them temporarily add me as a administrator, and adding/installing the solution worked. Unfortunately, due to their security policies, this cannot remain in place.

share|improve this question
    
I also had to logout / login, so to clean up all the cache. –  user6000 Dec 13 '11 at 11:51
add comment

4 Answers

up vote 8 down vote accepted

To add solutions you need to be local administrator on top of shell admin. Run the shell as administrator.

Edit:

As I said in comments, i cant find a specific requirement specified on TechNet, but I did a test on one of my farms:

  • First I added a brand new user to my AD.
  • As being member of the AD the users only right on my farm server is that its part of domain users, and hence part of local User group.
  • I fired up a SP2010 administration shell using Run as different user (right click on shell) and logged in as my new user. Already as I started up i got some errors because of lack of access (The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.)
  • I tried adding solution and got:

    Add-SPSolution : Cannot access the local farm. Verify that the local farm is pr operly configured, currently available, and that you have the appropriate permi ssions to access the database before trying again.

  • I now gave test user farm admin privileges and started up a new shell. Still got the same error.

  • I ran another Shell as my farm admin (if logged in as account remember to use Run As Administrator if you have UAC enabled). Here I added my test user as Shell Admin
  • I now started a new shell with my test user. No errors while loading, but when i tried adding I got the same error as you:

    Add-SPSolution: Access Denied

  • I then added the test user to the local administrator group and opened up a new shell.

  • When adding the user I could add the user without issues.

share|improve this answer
    
Ok, thanks. Do you have a reference for this? I can't find anything. I'll need to show our client. –  ScottE Dec 22 '10 at 0:43
    
I cant find it on TechNet, but found several references to this on MS fora and blogs. I did a test also on my local farm, se updated answer –  Anders Rask Dec 22 '10 at 8:20
    
Thank you Anders, I appreciate the effort. Odd that MS lets a farm/shell admin completely blow away a site collection but not install a solution. I suppose they are farm scoped, but can they really do more harm than deleting site collections?? –  ScottE Dec 23 '10 at 13:30
    
in stsadm it was the same: you needed to be local admin to use it for most purposes. being a farm admin will give you several permissions in registry and on file system (see here technet.microsoft.com/en-us/library/cc678863.aspx) so since this could be a file permission issue i tried uploading WSP from %windir%\temp (that WSS_ADMIN_WPG should have full control over) but still no dice, so i dont think theres any workaround on this unfortunately –  Anders Rask Dec 27 '10 at 8:59
2  
Here is the reference for permissions needed to deploy solutions: technet.microsoft.com/en-us/library/cc262995.aspx "You must be a member of the Administrators group on any computer on which you run Windows PowerShell." –  shufler Nov 15 '11 at 0:39
add comment

Per my own blog, if you’re encountering the following error, when trying to run a powershell script, you may not have sufficient permissions on the database.

Get-SPWeb : Cannot access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permission to access the database before trying again.

The issue can be remedied with a few quick powershell commands.

Perform the following script in the SharePoint Management Shell, as a farm administrator and it will remove the error.

Get-SPDatabase | Add-SPShellAdmin SomeDomain\SomeUserName

This will grant the user both access to the configuration database as well as the content database.

Alternatively, you can revoke that granted access with the opposite command.

Get-SPDatabase | Remove-SPShellAdmin SomeDomain\SomeUserName
share|improve this answer
add comment

Ok so what do you do when you are running everything on a Domain Controller that is also the host server for Active Directory Domain Services. When you run as Administrator you are not using the SharePoint 2010 Farm account.

So frustrating.

share|improve this answer
add comment

It's not a permissions issue. If you're trying to Run As a Different User, it will always fail no matter what.

That was my problem.

share|improve this answer
add comment

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.