SharePoint 2007 STSADM Overview

By:   |   Comments   |   Related: > SharePoint Administration


When SharePoint goes wrong or you need to do some "advanced" configuration, you are often referred to a tool called STSADM. This article gives you an overview of that tool.



Firstly lets clear up the name, STSADM stands for SharePoint Team Server Administration. (This is because many moons ago SharePoint was called Team Server. Those of you new to SharePoint will find Microsoft likes to change product names from time to time.)

STSADM is a command-line tool to help you administer SharePoint. It is more powerful than "SharePoint Central Administration" and allows you to script multiple commands. However, one small caveat here. Going forward Microsoft is encouraging us to use the new SharePoint PowerShell commands.

STSADM is located in your SharePoint (2007) installation directory, which is also often referred to as the SharePoint HIVE.

%COMMONPROGRAMFILES%\Microsoft Shared\Web Server Extensions\12\bin


C:\Program files\Common Files\Microsoft Shared\Web Server Extensions\12\bin

First tip - setting your Path

If you want to execute an STSADM command you have have to launch a command prompt (because it is a command line tool) and then navigate to the HIVE before then typing in the STSADM command.

A much better approach is to add the SharePoint HIVE to your operating systems Environment PATH variable. The net result of this will be the ability to execute STSADM from any location (it saves you navigating to the HIVE!).

  1. Connect to your SharePoint Server
  2. Load up "System Settings" (Right Click Computer and select Properties)
  3. system properties
  4. Click the Advanced tab on System Settings
  5. Click Environment Variables
  6. system properties
  7. On the Environment Variables dialog select the Path variable under System Variables. Click Edit.
  8. environment variables
  9. On the Edit System Variable dialog click the Variable Value field and press END on your keyboard.
  10. edit system variable
  11. At the end of the Variable Value field enter the following
    • ;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN
    • Note the semi colon at the beginning
    • Also note the number 12, this the path for SharePoint 2007 or WSS 3.0. Change this to 14 for SharePoint 2010
  12. Click OK on all of the open dialogs
  13. Test by opening a NEW command prompt and typing in "STSADM -help"

Operations and help

Often overlooked... STSADM has help built in!

command prompt

This is extremely useful especially if you are working on a server which is not allowed internet access. You can get help on the operation you are trying to execute by entering STSADM -help <operation name>

For example STSADM -help import, displays this:

command prompt

This help output shows me I have to provide the -url and -filename parameters but all the other parameters surrounded by square brackets [] are optional!

Here is a valid command using only the required parameters:

STSADM -o import -url http://sharepoint/HR -filename c:\temp\hr.cmp

Note: we have changed the -help parameter to -o. The o is short for operation.

Here is another example using one of the optional parameters:

STSADM -o import -url http://sharepoint/HR -filename c:\temp\hr.cmp -includeusersecurity

By the way, this particular command is great for exporting and importing sites across farms. The includeuserssecurity retains the permission structure on the import!

Here are a few other STSADM commands I use.

Review the deployed solution on the farm - help here

STSADM -o enumsolutions 

Rename server - help here

STSADM -o renameserver -oldservername <oldservername> -newservername <newservername>

Manage the Office SharePoint Search- help here

STSADM -o search -action list 

One last word of caution. Make sure you are very careful when using STSADM - you can break your SharePoint!

Next Steps
  • Review the Microsoft STSADM help here
  • Note: While this article shows the command (STSADM) in uppercase, the command is not case sensitive. Both STSADM and stsadm are correct.

sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip

About the author
MSSQLTips author Matt Takhar Matt Takhar

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips

Comments For This Article

get free sql tips
agree to terms