I would like to get my SharePoint server details remotely(from another device) through windows PowerShell.
As we know, to run the SharePoint commands in windows powershell we must add SharePoint PSSnap-In.
I am able to get the details when I try to run the SharePoint commands in my SharePoint server( locally) after adding this snap-in.
But facing a problem when I try to get it from remotely.
Even though I added this snap-in, SP related commands are not working remotely.
Can someone please help me on this.
I think there is a authentication issue as you are running PS from remote location, follow the below steps in sequence
1- Add PSSnapin
2- Get object of your SPSite
3- Grant access to specific user e.g.
$web = Get-SPWebApplication -Identity http://yourwebapplication
- Edited by Vivek Jagga Wednesday, April 19, 2017 9:28 AM
There is a TechNet blog about how to enable Remote PowerShell for SharePoint 2013, you can refer to it:
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact firstname.lastname@example.org
- Proposed as answer by Trevor SewardMicrosoft contingent staff, Moderator Friday, April 21, 2017 3:16 PM
Ideally to get SharePoint server details remotely outside of SharePoint server, you need to use client side model.
Instead of calling Add-PSSnapin Microsoft.SharePoint.PowerShell from windows powerShell, load the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime like below.[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
You might need to install the client components from https://www.microsoft.com/en-gb/download/details.aspx?id=35585 if you have not already done so else, the assemblies Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime won't load.
With client object model however , not all Share Point server details are accessible.
Client components aren't a replacement for SSOM. There are too many operations that are either significantly more complex or just outright unavailable. Wendy's post is the correct way to go about using remote PoSh with SharePoint.
Office Servers and Services MVP
Author, Deploying SharePoint 2016
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.