SharePoint 2010 PowerShell – Local Farm Is Not Accessible Issue

I recently got the following message when launching SharePoint 2010 Management Shell:-

“The local farm is not accessible.  Cmdlets with FeatureDependencyId are not registered.”

Now I got this error in my development SharePoint 2010 setup at work, which is installed on a Windows 7 Enterprise machine, that is connected to AD network.  The installation of SharePoint 2010 server was carried out following the standard instructions which are publically available on TechNet, and other materials which I have written about at:

Now the standard instructions that you will find when searching the Internet to fix the above problem is usually one of the following:-

  • The account you have launched PowerShell is not part of the local administrators group.
  • You launched PowerShell without the Administrator permissions (you usually do this by right clicking on it).
  • The account you are trying to run PowerShell with does NOT have rights to the SharePoint_Config database.
  • Use the Add-SPShellAdmin command to add your username to administer PowerShell.

You can search the net and find how to do each of the above things to resolve the situation, and you will also find many people who are unable to resolve the issue by doing any of the above.  In fact the last fix is a little strange as you will most likely get a big error message saying you do not have permission to use Add-SPShellAdmin.  So anyway, after looking around I gave up, I also had the problem that I could not launch the SharePoint 2010 PowerShell Management tool using the right-click ‘Run as Administrator’ option, as it did not appear.  So I tried doing the other things which were:-

  • to create a short cut and then adjust the properties of that short cut by selecting the ‘Run as Administrator option’ from the ‘Advanced’ button of the Shortcut tab.  Still no luck, – kept getting the same error.  Many blogs and tech articles will tell you to turn UAC on/off to get the option.  That did nothing for me!!!
  • The Compatibility tab of the shortcut had everything disabled, with the ‘Run this program in compatibility mode for:” option set to ‘Windows Server 2008 (service pack 1)’.  So I could not click on the ‘Run this program as an administrator’ check box.

So if you find yourself in the above situation like me – here is something that worked for me:-

  • I created a local account on the machine (not a domain account).
  • I assigned that account to the LOCAL administrators group.
  • Log in with the new account to the machine.
  • Launch the SharePoint 2010 Management shell – you should be able to right click on the short cut and launch as administrator now.

By doing the above I suddenly had the rights to administer my local SharePoint system !!!

Posted in: Microsoft TechBook

Leave a Reply