I am trying to run a SP PowerShell script remotely from my SP 2013 dev server.The target server is also a SP 2013 server with same configuration. I am able to get the folders, items, accessing the file system after enabling Enter-PSSession command. But when I try to connect the site in the remote server am getting the below error.

[remoteserver1Name]: PS C:\Users\muser1\Documents> $msite=Get-SPSite "http://mydms.prod.com/sites/gng"

Get-SPSite : 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. At line:1 char:8 + $msite=Get-SPSite "http://mydms.prod.com/sites/gng"

Am stuck at this, why I am getting cannot access local farm?

I am running the SP script with the same credential which has full access to the remote server machine.

  • @SaMoIPP p Does that user has permissions on the content DB?
    – Asad Refai
    Jul 8, 2015 at 10:08
  • Thanks for the reply.Yes, it has Full Access to the content db. I went to the security folder in the SSMS console on the sql server box and given the permissions.It has dbcreator,diskadmin,processadmin,public,securityadmin,serveradmin,setupadmin,sysadmin permissions
    – samolpp2
    Jul 8, 2015 at 10:11
  • i have followed the blog : blogs.msdn.com/b/varun_malhotra/archive/2010/06/10/…
    – samolpp2
    Jul 8, 2015 at 10:17

2 Answers 2


Try adding the -Credential parameter with Kerberos or a username and password. This way, you authenticate with the remote server.


  • I already passed the credential param .but in vain.
    – samolpp2
    Jul 13, 2015 at 15:22

You also need SPShellAdmin for running PS against the Farm.

Link here. also verify that you are in SharePoint Farm Administration group and have permissions set in SQL instance for ConfigDB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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