Install and Uninstall a Feature in SharePoint using stsadm.exe

Written by Denis Stadler on . Posted in IT Pro & PowerShell, SharePoint 2010

To deploy SharePoint Custom Features on different servers the easy way is to use stsadm.exe.

First, please:
– replace YourWSP.wsp with your WSP Package
– replace FeatureNameFolder with your Feature Folder Relative Path from 12 or 14 Hive \TEMPLATE\FEATURES (usually is should be the folder which contains the feature.xml file)
– replace http://site with your site

Using stsadm.exe for Installing Features and Packages in both MOSS 2007 and SharePoint 2010

rem Solution Package
rem ================
stsadm -o addsolution -filename YourWSP.wsp
stsadm -o deploysolution -name YourWSP.wsp -allowgacdeployment -force -immediate

rem Feature
rem ================
stsadm -o installfeature -filename FeatureNameFolder\feature.xml -force
stsadm -o activatefeature -filename FeatureNameFolder\feature.xml -url http://site -force

Using stsadm.exe for Uninstalling Features and Packages in both MOSS 2007 and SharePoint 2010

rem Feature
rem ================
stsadm -o deactivatefeature -filename FeatureNameFolder\feature.xml -force -url http://site
stsadm -o uninstallfeature -filename

rem Solution Package
rem ================
stsadm -o retractsolution -name YourWSP.wsp -url http://site -immediate
stsadm -o deletesolution -name YourWSP.wsp

Tags: , , , , , , , ,

Trackback from your site.

Denis Stadler

I'm a technology enthusiast, with more than 10 years of experience in SharePoint and Dynamics CRM projects. To find more details about, please visit the about me page.

Comments (2)

  • Ahmad


    Thank you very much :) its really very helpfull :)



  • Patrick Murphy


    Thank you for this…It fixed what I have been trying to deploy for 2 weeks!


Leave a comment