Thursday, 10 January 2013

Powershell Script to Extract wsp from SharePoint Farm Solutions


Below is the Powershell Script used to extract the wsp solution from the SharePoint farm Gallery:

$farm = Get-SPFarm
$file = $farm.Solutions.Item("solutionname.wsp").SolutionFile
$file.SaveAs("E:\Backup\solutionname.wsp")

If the solution is not extracted from the solution using the above script which means the current user needs the admin rights to extract the solution. The Below command Adds a user to the  SharePoint_Shell_Access  role  for  the  specified  database:

Add-SPShellAdmin –UserName <username>

No comments:

Post a Comment