Tuesday, January 18, 2011

Basic STSADM Commands

Working with SharePoint on a daily basis you'll need to have some basic STSADM knowledge, the following post will hopefully provide you with the basics you need to get started.

Physical location:
The 'stsadm.exe' executable resides in the 12 hive bin folder, the hive can be found under:
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\"

Usage:
stsadm.exe -o  []
stsadm.exe -help []
1) Open Command Prompt (Run as administrator)
2) Change directory to hive \BIN folder


Here's some basic stsadm commands examples:

Add the solution
stsadm -o addsolution
-filename 

Deploy the solution
stsadm -o deploysolution
-name  
[-url ] 
[-immediate] 
[-allowgacdeployment] 
[-force]

Install the feature
stsadm -o installfeature 
{-filename  
|| 
-name }
[-force]

Activate the feature
stsadm -o activatefeature 
{-filename 
|| 
-name  
|| 
-id } 
[-url ] 
[-force]


Deactive the feature
stsadm -o deactivatefeature 
{-filename  
|| 
-name  
|| 
-id } 
[-url ] 
[-force]

Uninstall the feature
stsadm -o uninstallfeature 
{-filename  
|| 
-name  
|| 
-id } 
[-force]

Retract Solution
stsadm -o retractsolution 
-name  
[-url ] 
[-immediate]

Delete Solution
stsadm -o deletesolution 
-name  
[-override]

Note: The full list of all commands can be foud using 'stsadm -help'

Update (2012-07-07):
SP2010 hive is 14 not 12 …\Microsoft Shared\Web Server Extensions\14\…
Use PowerShell / (SharePoint 2010 Management Shell) to achieve the same things as via ‘stsadm’ and lots lots more! ;)