10

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.

1
  • I also had to logout / login, so to clean up all the cache.
    – user6000
    Commented Dec 13, 2011 at 11:51

4 Answers 4

14

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 can't 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 properly configured, currently available, and that you have the appropriate permissions 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.

7
  • Ok, thanks. Do you have a reference for this? I can't find anything. I'll need to show our client.
    – ScottE
    Commented Dec 22, 2010 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 Commented Dec 22, 2010 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
    Commented Dec 23, 2010 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 Commented Dec 27, 2010 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
    Commented Nov 15, 2011 at 0:39
2

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
0
0

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.

2
  • any solution about it if you are running everything on a Domain Controller ?
    – Kiquenet
    Commented Jul 7, 2014 at 9:01
  • I try add the user to the local administrator group but the server is Domain Controller. Thuan Nguyen SharePoint MVP @nnthuan says "You CAN'T create a local account on the domain controller."
    – Kiquenet
    Commented Jul 7, 2014 at 9:28
0

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.

Try "run as administrator" instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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