How to access the web-application hosted on the another Farm using SharePoint 2010 Management Shell?
-
16-10-2019 - |
Question
I am trying to access the web-application that is hosted on the another SharePoint 2010 Farm using SharePoint 2010 Management Shell cmdlets but it is failing with the below error message
$spsite = Get-SPSite http://demoserver:8080<br/>
Get-SPSite : Cannot find an SPSite object with Id or Url: http://demoserver:8080.
At line:1 char:21
+ $spsite = Get-SPSite <<<< http://demoserver:8080
+ CategoryInfo : InvalidData: (Microsoft.Share...SPCmdletGetSite:SPCmdletGetSite) [Get-SPSite], SPCm
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetSite
same account is used as a FARM account in both the Farms.
Even, I tried with the below powershell script also failed.
[void][reflection.assembly]::Loadwithpartialname("Microsoft.SharePoint")
$spsite=[Microsoft.SharePoint.SPSite]("http://demoserver:8080")
Is that mean that we can't access the web-application hosted on another Farm?
Solution
First you need to enable PowerShell remoting: Enable-PSRemoting
You'll want to use these commands as well:
Here's a blog post that describes the steps.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange