Pages

Monday, December 16, 2013

Extract all of the Solutions from your SharePoint Farm

If you don’t have all the WSPs handy, your upgrade is not doomed. It is possible to
extract all the farm solutions from your SharePoint 2010 farm using PowerShell.
Of course it is!

Run the following PowerShell statement on a server in your SharePoint
2010 farm:

(Get-SPFarm).Solutions | ForEach-Object{
  $var = (Get-Location).Path + "\" + $_.Name;
   $_.SolutionFile.SaveAs($var)
}




Install Farm Solutions to SharePoint 


# Add all WSP files in the current direction to SharePoint
Get-ChildItem | ForEach-Object{Add-SPSolution -LiteralPath $_.Fullname}
# Deploy all solutions in the farm
Get-SPSolution | ForEach-Object {If ($_.ContainsWebApplicationResource -eq $False)
{Install-SPSolution -Identity $_ -GACDeployment}
else {Install-SPSolution -Identity $_ -AllWebApplications -GACDeployment}}

Provisioning the State Service in SharePoint 2010 and SharePoint 2013

The State Service service application is used to maintain state. This is one of those goofy .NET
developer things which is the equivalent of writing on your hand. It holds the information
temporarily while you use it and then it goes away. Some people assume this isn’t necessary but even
out-of-the-box features use it so just go ahead and provision it to save looking up the error messages
later. Because there is no GUI to do you will be using the SharePoint Management Shell.

1. At the prompt, type the following and press Enter:
New-SPStateServiceApplication -Name "State Service Application"

2. At the prompt, type the following and press Enter:
Get-SPStateServiceApplication| New-SPStateServiceApplicationProxy -defaultproxygroup

3. At the prompt, type the following and press Enter:
Get-SPStateServiceApplication| New-SPStateServiceDatabase -Name "State_Service_DB"

4. At the prompt, type the following and press Enter:
Get-spdatabase | where-object {$_.type -eq "Microsoft.Office.Server.Administration.StateDatabase"} | initialize-spstateservicedatabase