Install and deploy a SharePoint (WSP) Solution Package using SharePoint Shell

In this article, I’ll answer the below SharePoint Solution Package questions:

  • What is the SharePoint Solution Package (WSP)?
  • What’re the prerequisites to deploy a SharePoint Solution Package (WSP)?
  • How to deploy a SharePoint 2010/2013/2016 Solution Package (WSP) via PowerShell?
  • How to backup all the deployed SharePoint 2010/2013/2016 solutions (WSP) on the farm via PowerShell?
  • How to perform a bulk SharePoint 2010/2013/2016 Solution Package (WSP) deploy?

What is the SharePoint Solution Package?

The solution package is a distributed package that delivers your custom SharePoint Server development work to the Web servers or the application servers in your server farm.

The solution package is a CAB file with a .wsp file name extension and a manifest file.


Deploy a SharePoint Solution Package (WSP) Prerequisites

In order to deploy/remove a solution package using SharePoint Management Shell commands, you must first verify that you possess the following permissions:

  • SharePoint Farm Administrator.
  • You must be a member of the Administrators group on any computer on which you run Windows PowerShell.
  • db_owner permission on the content database.

Deploying a SharePoint 2010 Solution Package (WSP) via PowerShell

Uploads a SharePoint solution package to the farm via SharePoint 2010 Management Shell Cmdlet.

stsadm.exe -o addsolution -filename "C:\Solution\CustomPasswordField.wsp"

Deploys a SharePoint Solution Command via SharePoint 2010 Management Shell Cmdlet.

stsadm -o deploysolution -name CustomPasswordField.wsp -url http://Server/ -local -force

Deploying a SharePoint 2013/2016 Solution Package (WSP) via PowerShell

Uploads a SharePoint solution package to the farm via SharePoint 2013 Management Shell Cmdlet.

Add-SPSolution -LiteralPath "C:\Solution\CustomPasswordField.wsp"

Deploys an installed SharePoint Solution Command via SharePoint 2013 Management Shell Cmdlet.

Install-SPSolution -Identity  -WebApplication  [-GACDeployment]

Note: GACDeployment is the parameter that enables SharePoint to deploy the assemblies in the global assembly cache.


Deploy a SharePoint Solution package via Central Administration.

You can also deploy a SharePoint solution package via central administration as the following:

Note: You cannot upload a SharePoint solution to farm solution from Central Administration, you should use  Add-SPSolution cmdlet then use Central Administration to deploy the uploadedsolution!

  • Open Central Administration > System Settings >Manage farm solutions.

Manage Farm Solution

  • Click on the solution that needs to deploy.

Farm Solution List

  • Click on deploy solution.

Deploy solution via CA


Backup all the deployed SharePoint solutions (WSP) within the farm via PowerShell

  • Create a ‘WSPSolutions’ folder at any location.
  • Open SharePoint Management Shell as Administrator.
  • Run the below cmdlets to backup all the deployed WSP solution on your farm.
$FolderPath = "c:\WSPSolutions"
foreach ($solution in Get-SPSolution)
{
$id = $Solution.SolutionID
$title = $Solution.Name
$filename = $Solution.SolutionFile.Name
$solution.SolutionFile.SaveAs("$FolderPath\$filename")
}

Perform a bulk Solution Package (WSP) deploy in SharePoint

I suggest using the SharePoint Solution Deployer to perform a bulk WSP SharePoint solutions deploy. For download, https://spsd.codeplex.com/ 


Applies To
  • SharePoint 2016.
  • SharePoint 2013.
  • SharePoint 2010.
See also

How to Uninstall a SharePoint (WSP) Solution Package in SharePoint 2010 / 2013

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s