0

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

  • 1
    Please, don't change the question so radically. Now many of the answers bellow do not make sense anymore. – Hitodama Dec 10 '13 at 9:57
  • Sorry i thought it was invisible now cause of the duplicate – n0r1s Dec 10 '13 at 10:34
  • @n0r1s No, just marked as a duplicate. Mainly to guide users to the original question/answer. I'll try to evaluate if this actually is a dupe after the edit, and if not - repopen. – Benny Skogberg Dec 10 '13 at 11:56
0

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

  • I have to accounts...One supposed to be administrator but return the error access denied... the other one at the opening of powershell i got the message: The local farm is not accessible. Cmdlets with FeatureDependencyID are not registered – n0r1s Dec 9 '13 at 11:59
  • 1
    Karthik, if you spot a duplicate question like this; Flag it! Do not copy paste the answer from the already answered post, as you have done here (it could make you look bad, and we do not want that, do we? :) ) – Robert Lindgren Dec 9 '13 at 18:23
  • @RobertLindgren, what you said is correct, to mark it as duplicate, what should I do.?, Should I flag it and mention it as duplicate.? – Karthik Jaganathan Dec 10 '13 at 5:15
  • 1
    That would be terrific, that way other users and we moderators will be alerted and can take a look at it :) – Robert Lindgren Dec 10 '13 at 6:20
  • I've blockquoted your answer, and changed the link to the accepted answer instead of the question. – Benny Skogberg Dec 10 '13 at 15:44
4

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 .

  • Yes the account is listed – n0r1s Dec 9 '13 at 11:33

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