Monday, October 3, 2011

Extract and Download All Installed Solution Packages (WSP Files) in SharePoint

There were many solution packages installed in my current SharePoint environment. During a server replacement we noticed that the WSP file for a particular solution is missing in TFS! (Our version control repository!)

Thankfully, we have a solution to this issue using: http://archive.msdn.microsoft.com/SPSolutionExtractor. To extract and download all installed solution WSP files, Just execute:  
SharePointFarmSolutionExtractor.exe -extractAll c:\SharePointSolutions

which will extract all WSP files from installed solutions!
Download All Installed Solution Packages (WSP Files) in SharePoint

Download deployed solutions(WSP) from central admin with PowerShell in SharePoint 2010: 

$dirName = "c:\Solutions"
foreach ($solution in Get-SPSolution)
{
    $id = $Solution.SolutionID
    $title = $Solution.Name
    $filename = $Solution.SolutionFile.Name
    $solution.SolutionFile.SaveAs("$dirName\$filename")
}
 
If you want to download a particular solution, use this PowerShell Script:
$farm = Get-SpFarm
$SolutionFile = $farm.Solutions.Item("SolutionName.wsp").SolutionFile
$SolutionFile.SaveAs("D:\SolutionFile.wsp")

Download Installed Solution Packages in SharePoint 2007:
[void][reflection.assembly]::LoadWithPartialName("Microsoft.SharePoint")

#Get Farm object
[Microsoft.SharePoint.Administration.SPFarm]$farm = [Microsoft.SharePoint.Administration.SPFarm]::get_Local()

#Create a Directory for Solutions
if ( (Test-Path -path "c:\Solutions\") -ne $True)
{
 New-Item c:\Solutions\ -type directory
}


$dirName = "c:\Solutions"

foreach ($solution in $farm.Solutions)
{   
    Write-Host "Downloading solution $($Solution.Name)"
    $filename = $Solution.SolutionFile.Name
    $solution.SolutionFile.SaveAs("$dirName\$filename")
}  



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

1 comment :

  1. Thanks for nice article about "Want to Extract the .WSP file from installed Solutions in SharePoint?"

    Regards
    http://www.sharepoint.inf4web.com

    ReplyDelete

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...