In this article:
Microsoft Office SharePoint Server 2007 includes the Stsadm tool for command-line administration of Office SharePoint Server 2007 servers and sites. Stsadm is located at the following path on the drive where SharePoint Products and Technologies is installed: %COMMONPROGRAMFILES%\microsoft shared\web server extensions\12\bin. You must be an administrator on the local computer to use Stsadm.
Stsadm provides a method for performing the Office SharePoint Server 2007 administration tasks at the command line or by using batch files or scripts. Stsadm provides access to operations not available by using the Central Administration site, such as changing the administration port. The command-line tool has a more streamlined interface than Central Administration, and it allows you to perform the same tasks. There are certain operations and certain parameters that are only available by using the Stsadm command-line tool.
The command-line tool provides access to the complete set of Office SharePoint Server 2007 operations. You can use Stsadm from the command line or with batch files or scripts. Stsadm must be run on the server itself.
To use Stsadm, you must be a member of the local Administrators group on the server. When you invoke Stsadm, you supply an operation and a set of command-line parameters in the form:
-operation OperationName -parameter value
If a value you need to use with the command-line tool includes a space or a character that is treated as special by the command-line interface, such as an ampersand (&), you can enclose the string in quotation marks ("). For example, if the URL to a site is http://my site, you can enter the URL as "http://my site".
Most parameters for the command line also have a short form that you can use instead of the full parameter name. For example, the following command sets the configuration database to use Server1_collab on Server1 and specifies the database user name and password to connect with:
stsadm -o setconfigdb -connect -ds Server1 -dn Server1_collab -du User1 -dp password
The following table explains the commands and parameters from this example.
|Command or parameter||Definition|
Creates a connection between Office SharePoint Server 2007 and a configuration database.
Specifies that there is an existing configuration database to use.
Specifies the server name that contains the database to use.
Specifies the database name to use on that server.
Specifies an administrator user name for the database.
Specifies the password for the user.
Stsadm is not interactive
Stsadm is not an interactive tool. With Stsadm, you type the operation and parameters all at once. You will not be prompted to fill in missing parameters while the operation is running. If a required parameter is missing, the operation fails, and you must type the operation and parameters again.
This behavior allows better flexibility for batching commands, because the tools do not prompt you for information after you have submitted a command. If you want a more interactive tool, try using the administrative object model or Central Administration pages.
Available operations and properties
For a complete list of Stsadm operations and properties, see Index for Stsadm operations and properties (Office SharePoint Server).
The following operations are available only from the command line:
addcontentdb (the command line is required for adding databases that need to be upgraded)
restore (site collection level)
backup (site collection level)
The following parameters are available only from the command line: