Command-Line Operations

This topic lists and explains the operations you can perform with Stsadm.exe for Microsoft Windows SharePoint Services. For detailed information about the required and optional parameters, including short forms of the parameters, see Command-Line Parameters. For more information about using the command-line tool, see Introducing the Administration Tools for Windows SharePoint Services.

 Note   To use stsadm.exe, you must be a member of the local Administrators group for the server computer.

You can also get a list of the command-line operations by typing stsadm.exe -help on the command line. Syntax help for specific operations is available by typing stsadm.exe -help operation name.

Operations in This Topic

addalternatedomain

 Note   New in Windows SharePoint Services Service Pack 2 (SP2).

Configures the incoming URL and maps it to a URL zone. For each HTTP request, Windows SharePoint Services looks up the incoming URL and detmines which zone will be used to format the outgoing response. Note that you can perform a separate zone mapping for each virtual server.

Required parameters Optional parameters

-url

-incomingurl

-urlzone

none

Sample syntax:

 stsadm.exe -o addalternatedomain -url http://existing.sharepointvserver.URLdomain 
  -urlzone  -incomingurl http://incoming.url.domain 

The following table describes the properties associated with this command line operation.

Property Description
-url

URL of the virtual server as it is displayed on the Virtual Server List page in the SharePoint Central Administration site. If the virtual server is bound to a specific IP address or to a specific host header in Microsoft Internet Information Services (IIS), you can also use that IP address or host header as the value for this property.

 Note   The value of this property is displayed in the Virtual Server List in SharePoint Central Administration.

-urlzone Specifies which one of the five zones with which the outgoing URL is associated. The possible values for this property are: default, internet, intranet, extranet, or custom.
-incomingurl URL for any requests that come from the reverse proxy server or client to the Web server. You can map multiple incoming URLs to the same URL zone.

addpath

Adds a defined path (inclusion or exclusion) to a virtual server. For more information, see Managing Paths.

Required parameters Optional parameters

-url

-type

none

Sample syntax:

 stsadm.exe -o addpath -url url 
  -type exclusion/explicitinclusion/wildcardinclusion 

addtemplate

Adds a site template to the template gallery.

 Note   If you want the changes to the template list to take effect immediately, run the iisreset command after you run the addtemplate operation.

Required parameters Optional parameters

-filename

-title

-description

Sample syntax:

 stsadm.exe -o addtemplate -filename template filename 
  -title template title [-description template description] 

adduser

Adds a user account to the specified site and assigns it to the specified site group. Use the siteadmin parameter to register the user as the site administrator.

Required parameters Optional parameters

-url

-userlogin

-useremail

-role

-username

-siteadmin

Sample syntax:

 stsadm -o adduser -url url -userlogin DOMAIN\username 
  -useremail someone@example.com -role site group name
  -username user's display name [-siteadmin] 

addwppack

Adds a Web Part package to your server Web Part gallery. Use the globalinstall parameter to install the Web Parts in the global assembly cache (GAC) rather than in the Bin directories of each virtual server. Assemblies installed in the GAC are available to all applications on the server. The url parameter optionally specifies the URL of the virtual server on which to install the Web Parts. To install the Web Parts on every virtual server on a server, omit theurl parameter. Use the force parameter to overwrite an existing Web Part package with a new version, or to repair a Web Part package by reinstalling it. Use the lcid parameter to specify a language for the Web Part package.

Use filename to specify the path to the cabinet file containing the Web Parts and associated resources. If the Web Part package has already been installed on another server in a server farm configuration, you can install the Web Part package from the configuration database by using the name parameter.

Required parameters Optional parameters
either -filename or -name

-url

-globalinstall

-force

-lcid

Sample syntax:

 stsadm.exe -o addwppack -filename Web Part Package filename 
  [-url url] [-globalinstall] [-force] [-lcid language]
 

AddZoneUrl

 Note   New in Windows SharePoint Services SP2.

Maps the outgoing URL to the url configured with the addalternatedomain operation.

Required parameters Optional parameters

-url

-urlzone

-zonemappedurl

none

Sample syntax:

 stsadm.exe -o addzoneurl -url http://existing.sharepointvserver.URLdomain 
  -urlzone  -zonemappedurl http://outgoing.url.domain 

 Note   There can be only one outgoing URL per URL zone. This example uses the default URL zone.

The following table describes the properties associated with this command line operation.

Property Description
-url

URL of the virtual server as it is displayed on the Virtual Server List page in the SharePoint Central Administration site. If the virtual server is bound to a specific IP address or to a specific host header in IIS, you can also use that IP address or host header as the value for this property.

 Note   The value of this property is displayed in the Virtual Server List in SharePoint Central Administration.

-urlzone

Specifies which one of the five zones with which the outgoing URL is associated. The possible values for this property are: default, internet, intranet, extranet, or custom.

 Note   You can associate only one URL with an outgoing URL.

-zonemappedurl URL used in Web pages or e-mail messages going from the Web server to the reverse proxy server or the client. This URL is the one that can be reached by the end user. This step ensures that the end user sees the correct URL when the URL is returned from the server to the client.

backup

Creates a backup of the site at the specified URL. Use the overwrite parameter to replace an existing backup file.

Required parameters Optional parameters

-url

-filename

-overwrite

Sample syntax:

 stsadm.exe -o backup -url url -filename filename [-overwrite] 

binddrservice

Registers a data retrieval service for the list of data retrieval services that pertain to a specific setting on the Data Retrieval Services Settings page. Specify the service name and then the setting. Settings include enabled, responsesize, timeout, and update.

Required parameters Optional parameters

-servicename

-setting

none

Sample syntax:

 stsadm.exe -o binddrservice -servicename service name -setting enabled/responsesize/timeout/update
 

createadminvs

Creates the administration virtual server for Microsoft Windows SharePoint Services. Use the admapid... parameters to create a new application pool for IIS, or to specify the application pool to use for the administration virtual server.

 Note   This operation is intended for use by other products, and not by administrators of Windows SharePoint Services.

Required parameters Optional parameters
none

-admapcreatenew

-admapidname

-admapidtype

-admapidlogin

-admapidpwd

-exclusivelyusentlm

Sample syntax:

 stsadm.exe -o createadminvs [-admapcreatenew] 
  [-admapidname app pool id] 
  [-admapiptype configurableid/NetworkService/LocalService/LocalSystem]
  [-admapidlogin app pool user account] [-admapidpwd app pool password] [ -exclusivelyusentlm yes/no] 

createsite

Creates a site at the specified URL with the specified user as owner and administrator. If you do not specify the template to use, the owner can choose the template when he or she first browses to the site.

Required parameters Optional parameters

-url

-ownerlogin

-owneremail

-ownername

-lcid

-sitetemplate

-title

-description

-quota

Sample syntax:

 stsadm.exe -o createsite -url url 
  -ownerlogin DOMAIN\username -owneremail someone@example.com 
  [-ownername display name] [-lcid language] 
  [-sitetemplate site template] [-title title]
  [-description description] [-quota quota template] 

 Note   You must specify the -lcid option when using a non-English template.

createsiteinnewdb

Creates a site at the specified URL and creates a new content database with the username and password you specify. If you do not specify the template to use, the owner can choose the template when he or she first browses to the site.

Required parameters Optional parameters

-url

-ownerlogin

-owneremail

-ownername

-databaseuser

-databasepassword

-databaseserver

-databasename

-lcid

-sitetemplate

-title

-description

-secondarylogin

-secondaryemail

-secondaryname

Sample syntax:

 stsadm.exe -o createsiteinnewdb -url url 
  -ownerlogin DOMAIN\username -owneremail someone@example.com 
  [-ownername owner's name]
  [-databaseuser databaseusername] [-databasepassword databasepassword] 
  [-databaseserver databaseserver] [-databasename databasename] 
  [-lcid language] [-sitetemplate site template] 
  [-title title] [-description description]  
  [-secondarylogin DOMAIN\username] [-secondaryemail someone@example.com]
  [-secondaryname secondary owner's name] 

 Note   You must specify the -lcid option when using a non-English template.

createweb

Creates a subsite at the specified URL. If you do not specify the template to use, the owner can choose the template when he or she first browses to the site. Use the unique parameter to specify unique permissions for the subsite.

Required parameters Optional parameters
-url

-lcid

-sitetemplate

-title

-description

-convert

-unique

Sample syntax:

 stsadm.exe -o createweb -url url [-lcid language] 
  [-sitetemplate site template] [-title title] 
  [-description description] [-unique] [-convert] 

 Note   You must specify the -lcid option when using a non-English template.

deleteadminvs

Deletes the administration virtual server for Windows SharePoint Services.

This operation is intended for use by other products, and not by administrators of Windows SharePoint Services. If you delete the administrative virtual server for Windows SharePoint Services, you can no longer manage Windows SharePoint Services. This operation cannot be undone.

Required parameters Optional parameters
none none

Sample syntax:

 stsadm.exe -o deleteadminvs 

deletealternatedomain

 Note   New in Windows SharePoint Services SP2.

Deletes alternate domains created with the addalternatedomain operation.

 Note   If you previously used the Addalternatedomain command-line operation to map an incoming URL and you want to change that URL, you must first use this operation to delete the existing incoming URL and then use the Addalternatedomain command-line operation to map a new one.

Required parameters Optional parameters

-url

-incomingurl

none

Sample syntax:

 stsadm.exe -o deletealternatedomain -url http://existing.sharepointvserver.URLdomain 
  -incomingurl  http://incoming.url.domain 

The following table describes the properties associated with this command line operation.

Property Description
-url URL of the virtual server as it is displayed on the Virtual Server List page in the SharePoint Central Administration site. If the virtual server is bound to a specific IP address or to a specific host header in IIS, then you can also use that IP address or host header as the value for this property.
-incomingurl URL for any requests that come from the reverse proxy server or client to the Web server. You can map multiple incoming URLs to the same URL zone.

deleteconfigdb

Deletes the configuration database for Windows SharePoint Services.

Required parameters Optional parameters
none none

Sample syntax:

 stsadm -o deleteconfigdb 

deletepath

Removes an included or excluded path from the list of paths managed by Windows SharePoint Services.

Required parameters Optional parameters
-url none

Sample syntax:

 stsadm -o deletepath -url url 

deletesite

Deletes the specified site. To delete users from Active Directory directory services, specify true for the deleteadaccounts parameter.

Required parameters Optional parameters
-url none
-deleteadaccounts

Sample syntax:

 stsadm.exe -o deletesite -url url -deleteadaccounts true/false 

deletetemplate

Deletes the specified site template.

Required parameters Optional parameters
-title -lcid

Sample syntax:

stsadm.exe -o deletetemplate -title template title [-lcid language] 

deleteuser

Deletes the specified user.

Required parameters Optional parameters

-url

-userlogin

none

Sample syntax:

 stsadm -o deleteuser -url url -userlogin DOMAIN\username 

deleteweb

Deletes the specified subsite.

Required parameters Optional parameters
-url none

Sample syntax:

 stsadm.exe -o deleteweb -url url 

deletewppack

Removes the Web Parts in a Web Part package from a virtual server. When you delete the last instance of a Web Parts package on a server or server farm, Stsadm.exe also deletes the Web Part package from the configuration database.

The parameter name specifies the name of the Web Part package. The parameter url optionally specifies the URL of the virtual server on which to delete the Web Parts. If url is omitted, Stsadm.exe deletes the Web Parts from the Bin folder of every virtual server on the server or from the global assembly cache.

Use the lcid parameter to remove a particular language version of a Web Part package.

Required parameters Optional parameters
-name

-url

-lcid

Sample syntax:

 stsadm -o deletewppack -name name of Web Part package [-url url] [-lcid language] 

deletezoneurl

 Note   New in Windows SharePoint Services SP2.

Deletes previously created zone urls created with the addzoneurl operation.

Required parameters Optional parameters

-url

-urlzone

none

Sample syntax:

 stsadm.exe -o deletezoneurl -url http://existing.sharepointvserver.URLdomain 
  -urlzone  

The following table describes the properties associated with this command line operation.

Property Description
-url URL of the virtual server as it is displayed on the Virtual Server List page in the SharePoint Central Administration site. If the virtual server is bound to a specific IP address or to a specific host header in IIS, then you can also use that IP address or host header as the value for this property.
-urlzone Specifies which one of the five zones with which the outgoing URL will be associated. The possible values for this property are: default, internet, intranet, extranet, or custom.

disablessc

Disables Self-Service Site Creation for the specified virtual server.

Required parameters Optional parameters
-url none

Sample syntax:

 stsadm -o disablessc -url url 

disablestsisapis

 Note   This operation has been replaced by the following operations in Windows SharePoint Services SP2 and later. See addalternatedomain and addzoneurl.

Disables the Windows SharePoint Services ISAPI extensions. This operation is used by the Setup program for Windows SharePoint Services.

Required parameters Optional parameters
none none

Sample syntax:

 stsadm -o disablestsisapis 

email

Sets the e-mail configuration settings for your server, or for a specific virtual server (when you use the url parameter).

Required parameters Optional parameters

-outsmtpserver

-fromaddress

-replytoaddress

-codepage

-url

Sample syntax:

stsadm.exe -o email -outsmtpserver SMTP server 
  -fromaddress someone@example.com -replytoaddress someone@example.com 
  -codepage codepage [-url url] 

enablessc

Enables Self-Service Site Creation for the specified virtual server.

Required parameters Optional parameters
-url -requiresecondarycontact

Sample syntax:

 stsadm -o enablessc -url url [-requiresecondarycontact] 

enablestsisapis

 Note   This operation has been replaced by the following operations in Windows SharePoint Services SP2 and later. See addalternatedomain and addzoneurl.

Enables the Windows SharePoint Services ISAPI extensions. This operation is used by the Setup program for Windows SharePoint Services.

Required parameters Optional parameters
none none

Sample syntax:

 stsadm -o enablestsisapis 

enumalternatedomains

 Note   New in Windows SharePoint Services SP2.

Lists the incomingURLs and which URL zones and outgoing URLs they are mapped to.

Required parameters Optional parameters
-url none

Sample syntax:

stsadm.exe –o enumalternatedomains –url http://sharepoint:1234 

The following table describes the property associated with this command line operation.

Property Description
-url URL of the virtual server as it is displayed on the Virtual Server List page in the SharePoint Central Administration site. If the virtual server is bound to a specific IP address or to a specific host header in IIS, then you can also use that IP address or host header as the value for this property.

enumroles

Lists the site groups that are available for use in a particular site or subsite.

Required parameters Optional parameters
-url none

Sample syntax:

 stsadm -o enumroles -url URL 

enumsites

Lists all of the sites that have been created under a particular virtual server. The url parameter must be the URL of a virtual server.

Required parameters Optional parameters
-url none

Sample syntax:

 stsadm -o enumsites -url URL 

enumsubwebs

Lists the subsites that have been created under a particular site.

Required parameters Optional parameters
-url none

Sample syntax:

 stsadm -o enumsubwebs -url URL 

enumtemplates

Lists the site templates that are available.

Required parameters Optional parameters
none -lcid

Sample syntax:

stsadm.exe -o enumtemplates [-lcid language] 

enumusers

Lists the users of a particular site or subsite.

Required parameters Optional parameters
-url none

Sample syntax:

stsadm.exe -o enumusers -url url 

enumwppacks

Lists the Web Part Packages currently in your server Web Part gallery.

Required parameters Optional parameters
none

-name

-url

Sample syntax:

 stsadm -o enumwppacks [-name name of Web Part Package]
   [-url URL]  

enumzoneurls

 Note   New in Windows SharePoint Services SP2.

Lists the outgoing URLs and which URL zones they are mapped to.

Required parameters Optional parameters
-url none

Sample syntax:

 stsadm.exe -o enumzoneurls -url http://existing.sharepointvserver.URLdomain 

The following table describes the property associated with this command line operation.

Property Description
-url URL of the virtual server as it is displayed on the Virtual Server List page in the SharePoint Central Administration site. If the virtual server is bound to a specific IP address or to a specific host header in IIS, you can also use that IP address or host header as the value for this property.

extendvs

Extends a virtual server with Windows SharePoint Services and creates a new content database.

 Note   Extending a virtual server creates a site but does not require the createsite parameter. Use the donotcreatesite parameter if you do not want to create a site when you extend the virtual server.

Required parameters Optional parameters

-url

-ownerlogin

-owneremail

-exclusivlyusentlm

-ownername

-databaseuser (du)

-databaseserver (ds)

-databasename (dn)

-databasepassword (dp)

-lcid

-sitetemplate

-donotcreatesite

-apcreatenew

-apidname

-apidtype

-apidlogin

-apidpwd

Sample syntax:

 stsadm -o extendvs -url url -ownerlogin DOMAIN\username 
  -owneremail someone@example.com -exclusivlyusentlm yes/no [-ownername display name] 
  [-du database user] [-ds database server] [-dn database name] 
  [-dp database user password][-lcid lcid] [-sitetemplate site template]
  [-donotcreatesite] [-apcreatenew] [-apidname app pool name]
  [-apidtype configurableid/NetworkService/LocalService/LocalSystem] 
  [-apidlogin DOMAIN\username]
  [-apidpwd app pool password] 

extendvsinwebfarm

Extend a virtual server with Windows SharePoint Services for use in a server farm. This operation does not create a new content database, but allows you to connect to an existing virtual server (vsname) and use the same content database.

Required parameters Optional parameters

-url

-vsname

-exclusivlyusentlm

-apcreatenew

-apidname

-apidtype

-apidlogin

-apidpwd

Sample syntax:

 stsadm -o extendvsinwebfarm -url url -vsname virtual server name -exclusivlyusentlm yes/no
  [-apcreatenew] [-apidname app pool name]
  [-apidtype configurableid/NetworkService/LocalService/LocalSystem] 
  [-apidlogin DOMAIN\username]
  [-apidpwd app pool password] 

getadminport

Returns the administration port for Windows SharePoint Services.

Required parameters Optional parameters
none none

Sample syntax:

 stsadm -o getadminport 

getproperty

Returns the property value for the specified property name. For a list of valid properties, see Command-Line Properties.

Required parameters Optional parameters
-propertyname (pn) -url

Sample syntax:

 stsadm -o getproperty -pn property name [-url url] 

migrateuser

Required Parameter Optional parameter
-oldlogin %DOMAIN\name# -ignoresidhistory
-newlogin %DOMAIN\name#

Sample syntax:

stsadm -o migrateuser -oldlogin DOMAIN\name-newloginDOMAIN\name [-ignoresidhistory]

recalcuatestorageused

Used to recalcuate storage used for a virtual server

Required Parameter Optional Parameter
-url virtual server url none

Sample syntax

stsadm -o recalculatestorageused virtual server url

removedrservice

Removes a data retrieval service from the list of data retrieval services that pertain to a specific setting on the Data Retrieval Services Settings pages. Specify the service name, and then the setting. Settings include enabled, responsesize, timeout, and update.

Required parameters Optional parameters

-servicename

-setting

none

Sample syntax:

 stsadm.exe -o removedrservice -servicename service name -setting enabled/responsesize/timeout/update
 

renameweb

Renames the specified subsite.

Required parameters Optional parameters

-url

-newname

none

Sample syntax:

 stsadm.exe -o renameweb -url url -newname new subsite name 

restore

Restores a Web site from a backup file. Use the overwrite parameter to replace any existing Web site at the new location.

Required parameters Optional parameters

-url

-filename

-overwrite

Sample syntax:

 stsadm.exe -o restore -url url -filename filename [-overwrite] 

setadminport

Sets the port number for the administration virtual server for Windows SharePoint Services. Use the ssl parameter to specify a Secure Sockets Layer (SSL) connection to the port. Use the admap... parameters to specify the IIS application pool to use or to create a new IIS application pool for the administration virtual server.

Required parameters Optional parameters
-port

-ssl

-admapcreatenew

-admapidname

-admapidtype

-admapidlogin

-admapidpwd

Sample syntax:

 stsadm.exe -o setadminport -port port [-ssl]
  [-admapcreatenew] [-admapidname app pool id] 
  [-admapiptype configurableid/NetworkService/LocalService /LocalSystem]
  [-admapidlogin app pool user account] [-admapidpwd app pool password] 

setconfigdb

Creates the configuration database or specifies the connection to an existing configuration database. Setting the configuration database is required before a virtual server can be extended.

Required parameters Optional parameters
-databaseserver (ds)

-connect

-databaseuser (du)

-databasepassword (dp)

-databasename (dn)

-hh

-adcreation

-addomain

-adou

Sample syntax:

 stsadm.exe -o setconfigdb [-connect] -ds database server 
  [-du database user] [-dp database user password] [-dn database name]
  [-hh] [-adcreation] [-addomain AD domain] [-adou AD OU] 

setproperty

Sets the specified property with the specified value. Use the url property to specify a virtual server or site collection to apply the property to, or omit the url parameter to apply the property at the server or server farm level. For a list of valid properties, see Command-Line Properties.

Required parameters Optional parameters

-propertyname (pn)

-propertyvalue (pv)

-url

Sample syntax:

 stsadm.exe -o setproperty -pn property name
  -pv property value [-url url] 

siteowner

Sets the owner or secondary owner of a site collection. Either the ownerlogin or secondownerlogin parameter must be used.

Required parameters Optional parameters

-url

either -ownerlogin or -secondownerlogin

none

Sample syntax:

 stsadm.exe -o siteowner -url url   [-ownerlogin DOMAIN\username | -secondownerlogin DOMAIN\username]  

unextendvs

Removes Windows SharePoint Services from a particular virtual server. Use the deletecontent parameter to delete the content databases for the virtual server.

Required parameters Optional parameters
-url -deletecontent

Sample syntax:

 stsadm.exe -o unextendvs -url url [-deletecontent] 

uninstall

Uninstalls Windows SharePoint Services from the default virtual server at port 80. Any other virtual servers that were extended with Windows SharePoint Services will not be unextended. Uninstall removes the Windows SharePoint Services ISAPI extensions and any virtual directories or other files from the virtual server. It does not delete the content databases unless you include the deletecontent parameter. This operation is used by the Setup program for Windows SharePoint Services.

Required parameters Optional parameters
none -deletecontent

Sample syntax:

 stsadm.exe -o uninstall [-deletecontent] 

upgrade

Upgrades the server or the specified virtual server with Windows SharePoint Services. This operation is used by the Setup program for Windows SharePoint Services.

Required parameters Optional parameters
none

-url

-forceupgrade

-quiet

Sample syntax:

 stsadm.exe -o upgrade [-url url] [-forceupgrade ] [ -quiet ] 

userrole

Specifies the site group membership for a user. Use the add and delete parameters to specify whether to add the user to a site group or remove the user from a site group.

Required parameters Optional parameters

-url

-userlogin

-role

-add

-delete

Sample syntax:

 stsadm.exe -o userrole -url url -userlogin DOMAIN\username 
  -role site group name [-add] [-delete]
 
 
 
Applies to:
Deployment Center 2003