help with loading SharePoint PSSnapin

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Tim Pringle Tim Pringle 1 year, 10 months ago.

  • Author
    Posts
  • #22262
    Profile photo of Lance Rosser
    Lance Rosser
    Participant

    do i have to have SharePoint installed in order to load the SharePoint PowerShell snapin?

    My team has a SharePoint site that we do not manage. However, our SharePoint team is fine with us writing any tools (.NET or PowerShell) to manipulate our data located in our SharePoint site.

    The only think is we can't do anything on the SharePoint server itself.

    So we are wondering if we could use PowerShell from one of our servers (currently does not have SharePoint installed) to connect and view (not change) our SharePoint data.

    It this something that is commonly done or even possible?

  • #22264
    Profile photo of Tim Pringle
    Tim Pringle
    Participant

    Hey Lance,

    They aren't available as a separate module. There's two options that I've found :

    The first is simply to use a remote session from PowerShell. You'll need to make sure that you import the required module once connected, but other than that it works fine. Of course if you want to run a script against the SharePoint box, then just use Invoke-Command

    The second, is to use implicit remoting, where you actually export the commands from the remote computer onto your own computer. PowerShell does some nifty stuff, setting up a proxy for these commands so that they are routed to the target box dynamically. Take a look at the help for Export-ModuleMember to get a better idea what's involved. I'm sure I've got a script kicking about for this somewhere, will do some digging.

    NB. The second option doesn't always work as expected so I'd usually favor the first option for remoting.

You must be logged in to reply to this topic.