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

Yes, I am logged into the machine as an administrator, and my domain account id a farm admin as well. The site is running properly, and nothing seems wrong in SP Central Administration. But when I start powershell, I get "Cannot access the local farm"

Also, running powershell with admin rights.

Where do I start to diagnose this issue?

Cheers, Daniel

share|improve this question
add comment

4 Answers

I know you are a farm admin, but try right clicking on Powershell, and select 'Run as Administrator'

share|improve this answer
add comment
up vote 14 down vote accepted

Found it. My account needed proper rights in Sql Server, per this post:

http://www.sharepointassist.com/2010/01/29/the-local-farm-is-not-accessible-cmdlets-with-featuredependencyid-are-not-registered/comment-page-1/#comment-1566

It worked once I set "Sharepoint_Shell_Access" to the Sharepoint_Config database.

What got me here was searching for the first message: "the local farm is not accessible"

share|improve this answer
    
You should mark your own answer (with the check mark) –  Gabriel Mongeon Jun 8 '11 at 20:43
    
ah, would do so, but need to wait 2 days for some reason. odd –  Daniel Williams Jun 8 '11 at 21:33
    
this is so people dont just boost their rep answering their own questions :-) –  Anders Rask Jun 9 '11 at 12:56
    
Also remember UAC can be an issue here. Check my blog post on that issue sites.wizdim.com/andersrask/sharepoint/… –  Anders Rask Jun 9 '11 at 12:57
add comment

I had the same issue.

The local farm is not accessible

But after restart and repeating Add-PSSnapin Microsoft.SharePoint.Powershell it worked perfectly.

share|improve this answer
add comment

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
1  
Quin Johns - It worked like a charm - Thanks :) –  user14861 Feb 13 '13 at 7:08
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.