Adding, Deploying, Removing, and Most All Things Involving Solutions and SharePoint 2010

Part of being an administrator in SharePoint is you have to able to navigate solutions packages. While I won’t get into all the details of what a solutions package is and does for SharePoint, suffice to say that they will add functionality to your SharePoint site.

In our example I’ll use the Codplex MiniCalendar Web Part.

When you download this solution package you will see that it will come as a <FILE>.wsp format. So the question becomes: how do I go from this WSP file to a deployed and usable solution? In SharePoint to add a solution package you must use the command line. Since I’m dealing with SharePoint 2010 I’ll be showing you how to use PowerShell. There are equivalent methods in SharePoint 2007 using the STSADM command.

Lets download the above web part that will be deployed via a solution package.  For the sake of clarity I downloaded it into the root of the ‘C:’ drive, but you can download it as you prefer. Next, lets open our new friend Powershell with SharePoint applets added. This can be done by opening:

Start>All programs>Microsoft SharePoing 2010 Products>SharePoint 2010 Management Shell.

I won’t bore here with details but you should see a command like window with the somethink like the following text.

PS C:\Users\sp_admin\Desktop>

Remember this isn’t a ordinary command line it’s our PowerShell with SharePoint 2010 goodness.

First lets take a look at what solutions are installed. Type in:


From the picture we can see there is only one solution installed.

SP2010 get-solution

Nothing to fancy. You must be thinking to your yourself, ‘Hey can’t I see that in Central Admin?’. Why yes you can… go to:

Central Admin>system settings>farm management>Manage farm solutions

SP2010 central admin solutions

Why bother learning the PowerShell if you can deploy, retract, remove solution from central admin? Because, you can’t add or upgrade from central admin. Back to PowerShell we go.

I Need to Add and Deploy
Lets type in the following.

add-spsolution -LiteralPath C:\CalendarWebpart.wsp

Fantastic, now that we have added the solution to our SharePoint farm. We can see from the following picture it is not yet deployed.

SP2010 solution added

We can see that because of the false flag in the deployed field. So the next part can all be done from within Central Admin GUI. I’m still working in PowerShell so I’ll continue down that route. Lets deploy the solution now that it has been added.

install-spsolution -Identity calendarwebpart.wsp -GACDeployment –WebApplication

SP2010 deployed

There are other flags that can be used. I’ll source link at the bottom of the post.

Great it’s been added and deployed, but I want to retract and remove

Now lets retract the solution. As in SharePoint 2007 retract and remove solution are different processes. Lets take our example we have here. Lets say we wanted to take it out of site, but still wanted it functional in another site. Well then we will need to retract it first.

PS C:\Users\sp_admin\Desktop> Uninstall-SPSolution -Identity calendarwebpart.wsp -WebApplication

Now lets remove the solution altogether from our SharePoint 2010 farm.

PS C:\Users\sp_admin\Desktop> remove-spsolution -Identity calendarwebpart.wsp

Lets verify it is gone.

SP2010 removed

Let me know if you have questions.

Source: Features and solutions cmdlets (SharePoint Server 2010)

About the Author

Leave a Reply

%d bloggers like this: