Search code examples
powershellsharepointpowershell-5.0

Error when adding powerShell snapins for Microsoft SharePoint


I have SharePoint PowerShell scripts that I need to run locally on PowerShell v5.0

I've tried to execute Add-PSSnapin "Microsoft.SharePoint.PowerShell" but it throws error:

The Windows PowerShell snap-in 'Microsoft.SharePoint.PowerShell' is not installed on this computer.

How do I download those dlls and install the snap-in?


Solution

  • You have to either RDP onto the SharePoint Server itself, or use a PSSession to connect to the Server via PowerShell like this:

    New-PSSession -ComputerName SP2013Server
    Add-PSSnapin Microsoft.SharePoint.Powershell
    

    To do this PSRemoting will need to be enabled on the Server