How to Install and deploy WSP SharePoint Solution Using PowerShell

In this post, we will learn how to install and deploy WSP SharePoint Solutions using PowerShell for SharePoint 2016, 2013, and SharePoint 2010.


What is the SharePoint Solution Package (WSP)?

The SharePoint solution package (WSP) 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.


What’re the required permissions to install and deploy WSP SharePoint Solutions?

You can use the farm account to deploy WSP SharePoint Solutions on your farm but this will require adding it to the Local Administrator Group at least during the deployment process! But actually, it’s not recommended and most organizations disallow the farm account to login to the server.

So Instead, you should use Setup Account to deploy a WSP SharePoint solution package, or another account that should have the below permissions:

  1. SharePoint Farm Administrator.
  2. A member of the Local Administrators Group on any computer on which you run Windows PowerShell.
  3. A db_owner database base role permission on the SharePoint Config, Admin, and Content databases.

To check what are the main differences between Farm Account and Farm Administrator, Please check SharePoint Service Account Best Practices 2019/2016


How to install and deploy WSP SharePoint Solution Package?

As we know, you can’t add WSP SharePoint solution through the SharePoint Central Administration, and you must use the PowerShell to Add a new WSP solution to the SharePoint Solution Management.

SharePoint WSP Solutions list

Also, the SharePoint deployment process consists of two main steps:

  1. Add WSP SharePoint solution.
  2. Install WSP SharePoint Solution.

How to deploy WSP in SharePoint 2016 using PowerShell?

To deploy a SharePoint WSP solution in SharePoint 2016 and SharePoint 2013, you have to do the following:

  1. Open SharePoint Management Shell as Administrator.
  2. Type the below Add-SPSolution cmdlet to add the WSP solution.
Add-SPSolution -LiteralPath "C:\Solution\Qassas.wsp"
  1. Then, type the below Install-SPSolution cmdlet to deploy the WSP SharePoint Solution for a specific web application on your farm.
Install-SPSolution –Identity Qassas.wsp –WebApplication http://Server/ -GACDeployment

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

How to deploy WSP in SharePoint 2010 using PowerShell?

In SharePoint 2010,2007, you can use the below cmdlets to add and install a WSP SharePoint solution using stsadm

# Add WSP Solution in SharePoint using Powershell
stsadm.exe -o addsolution -filename "C:\Solution\Qassas.wsp"
# Install WSP Solution in SharePoint using Powershell
stsadm -o deploysolution -name Qassas.wsp -url http://Server/ -local -force

The STSADM is deprecated in SharePoint 2016.


How to deploy WSP SharePoint Solution using SharePoint Central Administration?

As we earlier mentioned, You cannot upload a SharePoint solution to farm solution from Central Administration, you must first use Add-SPSolution cmdlet to upload the WSP solution, then you can use PowerShell or Central Administration to deploy the uploaded solution!

To deploy WSP SharePoint Solution using SharePoint Central Administration, you should do the following:

  1. Open Central Administration > System Settings >Manage farm solutions.
Manage Farm Solution
  1. Click on the solution that needs to deploy.
SharePoint WSP Solutions list
  1. Click on deploy solution to install the solution
Deploy solution via CA

How to Backup all deployed SharePoint solutions (WSP) within the farm?

In Solution Management, there is no option to backup the deployed solution before deploying a new release, so that we have implemented a simple and smart PowerShell script that will help you to backup all deployed WSP solutions with versioning and log features to overcome this limitation in the SharePoint Solution Management.

backup all SharePoint WSP Solutions deployed on SharePoint farm

How to bulk deploy WSP SharePoint Solutions?

We have also implemented a new PowerShell Script called “WSP SharePoint Deployer” that would help you to safely and easily install and deploy WSP SharePoint 2019 solutions on your farm with Backup, Rollback, Logging, and Versioning capabilities.

install and deploy WSP SharePoint 2019 powershell

How to uninstall a WSP SharePoint Solution Package using PowerShell

To uninstall a SharePoint solution from your SharePoint farm, you must first retract the solution then remove it.

Retract SharePoint WSP Solution Package using PowerShell

Uninstall-SPSolution -Identity contoso_solution.wsp

Remove SharePoint WSP Solution Package using PowerShell

After retracting the Sharepoint solution, you can now remove it via the below Cmdlet:

Remove-SPSolution -Identity contoso_solution.wsp

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

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top