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.