Question

I'm getting this error while adding solution to prod farm...

enter image description here

a few weeks ago i found a website that gave me a line to write before launching any add command, but can't find it anymore

Secondly, the account that use powershell is admin to the farm...don't get it :s

Was it helpful?

Solution

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

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.

Source: Accepted answer to the question Sharepoint 2010 powershell add-spsolution access denied

OTHER TIPS

Just right-click PowerShell and click "Run as Administrator". If that does not work you then just run Get-SPShellAdmin and see if your account you are using is listed as a ShellAdmin. Initially, only the "Farm Admin" service account is a ShellAdmin (not the "Setup Admin" service account).

If your account is not listed, then use the Add-SPhellAdmin to add your account. You might run here into a vicious circle where you would still get "Access Denied" when running Add-SPShellAdmin. In this case just login as the "Farm Admin" service account and then add your initial account as a Shell Admin.

At this point, you can login back with your initial account, "Run As Administrator", and then run Add-SPSolution, and hopefully it works for you .

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top