Sunday, January 16, 2011

SharePoint WSP Solutions and Features Deployment using STSADM, PowerShell

In this article I'm documenting the Deployment of WSP files using STSADM and with the PowerShell.

Before we begin, Its a good idea to add STSADM's path ("C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\") to the environment variable "Path". It saves the typing :-)
and of course, its a good idea to have a Batch file for these activities.

It includes following steps:

  • Step 1: Add Solution to SharePoint Farm
  • Step 2: Deploy Solution
  • Step 3: Activate Solution features
Add the solution:
stsadm -o addsolution -filename <Path to the WSP file> say for eg. "C:\Deployment\myWSP.wsp"

Deploy the solution:
stsadm -o deploysolution -name <Path to the WSP file> -immediate -allowgacdeployment  -url <URL>   say for e.g. "C:\Deployment\myWSP.wsp"

On installing/Activating/De-Activating/Uninstalling the Features, following command shall be used:
stsadm -o installfeature -filename <FeatureFolder>\feature.xml

Activate the feature:
stsadm -o activatefeature -id <FEATUREID> -url <URL> -force

Deactive the feature:
Stsadm.exe -o deactivatefeature -filename “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\MyFeature\feature.xml” -url <URL>

Uninstall the feature:
stsadm -o uninstallfeature -filename “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\MyFeature\feature.xml”

Please note: if you are deploying a feature alone(with out WSP) you need to deploy the feature in ALL of the WFE's.

Retract Solution:
stsadm -o retractsolution -name <Name of the solution>

The GUI way:

Navigate to Central admin > Operations > solution Management

Select your WSP file to deploy, click on "Deploy solution", click "OK" that's All!

Here is the PowerShell way:
Fire the SharePoint 2010 Management Shell and type the following commands:

TO Add a New WSP:
Add-spsolution <Path to the WSP file> say for eg. "C:\Deployment\myWSP.wsp"

To deploy the WSP:
Install-spsolution –identity <Path to the WSP file> –gacdeployment

Deploy the WSP for a specify a URL:
Install-spsolution –identity <Path to the WSP file> –webapplication http://spsite –gacdeployment

In SharePoint 2010:
---------------------
Navigate to : Central Administration > System Settings > Manage Farm Solution

Select your WSP file to deploy, click on "Deploy solution", click "OK" that's All!

Here is the Technet article for the complete reference:
http://technet.microsoft.com/en-us/library/cc263231%28office.12%29.aspx



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:

No comments :

Post a Comment

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...