I am trying to use PowerShell ISE on my local client to access my SharePoint Farm. I am getting the error: "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 have given my account admin permissions in the: WSS_Admin_WPG on the SP Servers SharePoint_Shell_Access role on database Security_Admin role on the SQL instance db_owner role on the database (in fact I gave myself db_owner and SP_Data_Access on all of them at one point) I am also local admin on all the SharePoint servers

What am I missing?

  • I was talking to one of my former colleagues who has attempted a Windows server to SQL server from a client PC and he said it involves one more step. The server PC machine name also needs permissions on the SQL server machine as well as the necessary databases. So, the double hop needs both the user account and all computers involved in the permissions exchange. – Justin Feb 18 '17 at 23:22

When running PowerShell ISE, you need to Add-PSSnapin to Microsoft.SharePoint.PowerShell

if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = "ReuseThread"} 
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) 
     Add-PSSnapin "Microsoft.SharePoint.PowerShell"

Run this script and try again.

And as always, you have to be on the server when running scripts!

  • Thank you. I should have mentioned I can run the Add-PSSnapin successfully. – Justin Jan 25 '17 at 14:50
  • @Justin Great! If that helped you - you can accept this answer which will help others with the same problem. :) – Benny Skogberg Jan 25 '17 at 15:52
  • I wish that was all. At that point when I try to "Get-" anything from the farm, I get the error I posted. – Justin Jan 25 '17 at 16:01
  • @Justin You have to be on the server! – Benny Skogberg Jan 25 '17 at 16:20
  • 1
    Benny is correct, you need to run the script on the server where SharePoint is installed. – Gautam Sheth Jan 25 '17 at 17:41

You can't use the server object model from your client. You need to use the client object model. You can only load the snap-in on the server itself.

Download the client SDK from here: https://www.microsoft.com/en-gb/download/details.aspx?id=35585

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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