How to extract WSP from SharePoint 2010 Central Admin

Problem 


My Client requirement makes the exact replica of the SharePoint server to another location. There is some custom WSP installed on the server. So SharePoint 2010 Central admin will not allow us to download the WSP from there. Customer wanted to download the WSP Solutions.
stsadm, there’s not a command to download a solution.

Purposed solution:
  1. Using Console application to Extract WSP
  2. Using Power Shell Script
Implementation:

Using Console Application to Extract WSP
SPSolutionCollection solutions = SPFarm.Local.Solutions;
foreach (SPSolution solution in solutions)
{
    SPPersistedFile wspFile = solution.SolutionFile;
    wspFile.SaveAs("c:\\wsp\\" + solution.Name);
}
 Using Power Shell
$farm = Get-SPFarm
$file = $farm.Solutions.Item("custom.wsp").SolutionFile
$file.SaveAs("c:\temp\ custom.wsp")

Comments

Post a Comment

Popular posts from this blog

SharePoint RPC Protocols Examples Using OWSSVR.DLL

Send Email using SharePoint Rest API

Query suggestions in SP 2013 Using Rest API (/_api/search/suggest)