Solving: Uninstall-SPSolution : This solution contains resources scoped for a Web application
To uninstall a SharePoint WSP solution that is scoped for a web application without facing this error "Uninstall-SPSolution : This solution contains resources scoped for a Web application and must be retracted from one or more Web applications.", you have first to specify the scoped web application using this parameter
Uninstall-SPSolution -Identity 6ca32b40-73f1-4b3 9-8ed3-121ff6d46de5 -WebApplication http://webAppURL
If you don't know which web application you installed your SharePoint solution or the solution already deployed
globally, you can easily use
Uninstall-SPSolution -Identity 6ca32b40-73f1-4b3 9-8ed3-121ff6d46de5 -AllWebApplications
Once you have uninstalled (
retracted) the SharePoint Solution, you have to remove it using the below PowerShell cmdlet
Remove-SPSolution -Identity SP_solution.wsp
How to get the Deployed Web Applications for a SharePoint WSP Solution?
In case, you want to know which web applications you installed your SharePoint solution, you can use the below SharePoint PowerShell cmdlet
Get-SPSolution | select Name,DeployedWebApplications | Format-List
Also, you get the Deployed web applications URL for a SharePoint WSP solution through the SharePoint Central Administration by doing the following:
- Open Central Administration > Click on System Settings. > Below
Farm Management, click on
Manage farm solutions.
- Click on the WSP solution name to get the list of all deployed web applications for this WSP solution.