Pages

Monday, January 27, 2014

Get SharePoint WSP from Central Admin

SharePoint solution are most common way of deploying farm solutions in enterprise. There are times when we need to download the solution from central admin for variety of reason. Recently one of the client had a issue where they had multiple version of a DLL and they wanted to know which version of DLL is deployed with the SharePoint Solution. If you do not have a document or Change control process it is difficult to track back. What is a option now because we do not have any documentation on which version was deployed?

Only way out is to get eh WSP that was deployed and extract the WSP to get the DLL and reflect the DLL to find the solution.So far so good but how to get the WSP that was deployed to SharePoint. We cannot download the WSP from central admin through UI. How else we could do this? This is where the powershell panacea of all things SharePoint comes into play.

Powershell command exists to achieve this and we can use this to download the solution from Central Admin. 


$farm = Get-SPFarm  // Get Farm
$file = $farm.Solutions.Item("test.wsp").SolutionFile  // Get SOlution File
$file.SaveAs("c:\test\test.wsp") //Save solution file to Local directory
 
This is how easy to achieve the result using powershell. Make sure you are running this
command with admin privileges. 
 
There is no STSADM equivalent for this solution and I should thank my colleague for
introducing me to this powershell command.