MOSS / SharePoint 2007 – PowerShell script to download all farm solutions – requires while migration

Hi All,
Greetings for the day 🙂 LIFE IS BEAUTIFUL 🙂
SharePoint migration continues. Today new issue and solution.
Background :
- Recently I have an article to download all SharePoint farm solution in SharePoint 2010 environment – SharePoint OnPremises – PowerShell script to download farm solutions – .wsp files – requires while migration
- Now we have migration project from SharePoint 2007 / Moss to SharePoint 2016
- So one of the step is deploying our custom farm solution in SharePoint 2010 environment
- To execute above step we need to download all the farm solutions in MOSS environment
- We already have PowerShell script but it didnt worked completly in MOSS environment
- We need to do bit change in PowerShell script and hence this article 🙂
PowerShell script to download custom farm solutions from MOSS / SharePoint 2007 environment :
- Load SharePoint assembly
[System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")
- Get the farm object
#Get Farm object
[Microsoft.SharePoint.Administration.SPFarm]$farm = [Microsoft.SharePoint.Administration.SPFarm]::get_Local()
- set the directory where we need to download the farm solutions
$solDirName = "d:\MOSS Farm Solutions"
- Loop through each solution using “Solutions” property of “Farm” object => Farm.Solutions
- Get the name of solution
- Save the solution on file system as
foreach ($solution in $farm.Solutions)
{
Write-Host "Downloading solution $($Solution.Name)"
$solutionName= $Solution.SolutionFile.Name
$solution.SolutionFile.SaveAs("$solDirName\$solutionName")
}
Complete Script :
[System.Reflection.Assembly]::Load("Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c")
#Get Farm object
[Microsoft.SharePoint.Administration.SPFarm]$farm = [Microsoft.SharePoint.Administration.SPFarm]::get_Local()
$solDirName = "d:\MOSS Farm Solutions"
foreach ($solution in $farm.Solutions)
{
Write-Host "Downloading solution $($Solution.Name)"
$solutionName= $Solution.SolutionFile.Name
$solution.SolutionFile.SaveAs("$solDirName\$solutionName")
}
Thanks for reading 🙂 If its worth at least reading once, kindly please like and share 🙂 SHARE ING IS CARING 🙂
Enjoy the beautiful life 🙂 Have a FUN 🙂 HAVE A SAFE LIFE 🙂 TAKE CARE 🙂
1 Response
[…] MOSS / SharePoint 2007 – PowerShell script to download all farm solutions – requires while migra… […]
You must log in to post a comment.