Command-Line Operations

Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This topic lists and explains the operations you can perform withStsadm.exe. For detailed information about the required and optionalparameters, including short forms of the parameters, see Command-Line Parameters . For more information about usingthe command-line tool, see"Introducing the Administration Tools for " in the Windows SharePoint Services Administrator's Guide.

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 specificoperations is available by typing stsadm.exe -help <operationname> .

Operations in This Topic

  • addpath

  • addtemplate

  • adduser

  • addwppack

  • backup

  • binddrservice

  • createadminvs

  • createsite

  • createsiteinnewdb

  • createweb

  • deleteadminvs

  • deleteconfigdb

  • deletepath

  • deletesite

  • deletetemplate

  • deleteuser

  • deleteweb

  • deletewppack

  • disablessc

  • disablestsisapis

  • email

  • enablessc

  • enablestsisapis

  • enumroles

  • enumsites

  • enumsubwebs

  • enumtemplates

  • enumusers

  • enumwppacks

  • extendvs

  • extendvsinwebfarm

  • getadminport

  • getproperty

  • removedrservice

  • renameweb

  • restore

  • setadminport

  • setconfigdb

  • setproperty

  • siteowner

  • unextendvs

  • uninstall

  • upgrade

  • userrole

addpath

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

Requiredparameters

Optional parameters

-url

-type

<none>

Sample syntax:

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

addtemplate

Adds a sitetemplate 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.

Requiredparameters

Optional parameters

-filename

-title

-description

Samplesyntax:

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

adduser

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

Required parameters

Optional parameters

-url

-userlogin

-useremail

-role

-username

-siteadmin

Samplesyntax:

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 the url 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

Optionalparameters

either -filename or -name

-url

-globalinstall

-force

-lcid

Samplesyntax:

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

backup

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

Required parameters

Optionalparameters

-url

-filename

-overwrite

Samplesyntax:

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

Optionalparameters

-servicename

-setting

<none>

Samplesyntax:

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

createadminvs

Creates theadministration virtual server for Microsoft . Use the admapid... parameters to create a new application pool forIIS, or to specify the application pool to use for the administration virtualserver.

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

Required parameters

Optional parameters

<none>

-admapcreatenew

-admapidname

-admapidtype

-admapidlogin

-admapidpwd

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>]

createsite

Creates a site atthe specified URL with the specified user as owner and administrator. If you donot specify the template to use, the owner can choose the template when he or shefirst browses to the site.

Requiredparameters

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 databasewith the username and password you specify. If you do not specify the templateto use, the owner can choose the template when he or she first browses to thesite.

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 atthe specified URL. If you do not specify the template to use, the owner canchoose 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

-unique

Sample syntax:

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

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

deleteadminvs

Deletes theadministration virtual server for .

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

Required parameters

Optionalparameters

<none>

<none>

Sample syntax:

stsadm.exe -o deleteadminvs

deleteconfigdb

Deletesthe configuration database for .

Required parameters

Optionalparameters

<none>

<none>

Sample syntax:

stsadm -o deleteconfigdb

deletepath

Removes anincluded or excluded path from the list of paths managed by .

Required parameters

Optionalparameters

-url

<none>

Sample syntax:

stsadm -o deletepath -url <url>

deletesite

Deletes the specifiedsite. 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

Deletesthe specified site template.

Requiredparameters

Optional parameters

-title

-lcid

Sample syntax:

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

deleteuser

Deletes the specifieduser.

Required parameters

Optional parameters

-url

-userlogin

<none>

Samplesyntax:

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

deleteweb

Deletes the specifiedsubsite.

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

Optionalparameters

-name

-url

-lcid

Sample syntax:

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

disablessc

DisablesSelf-Service Site Creation for the specified virtual server.

Required parameters

Optionalparameters

-url

<none>

Sample syntax:

stsadm -o disablessc -url <url>

disablestsisapis

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

Required parameters

Optionalparameters

<none>

<none>

Sample syntax:

stsadm -o disablestsisapis

email

Sets the e-mailconfiguration settings for your server, or for a specific virtual server (whenyou use the url parameter).

Required parameters

Optionalparameters

-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-ServiceSite Creation for the specified virtual server.

Required parameters

Optionalparameters

-url

-requiresecondarycontact

Sample syntax:

stsadm -o enablessc -url <url> [-requiresecondarycontact]

enablestsisapis

Enablesthe ISAPI extensions. This operation is used by the Setup program for .

Required parameters

Optionalparameters

<none>

<none>

Sample syntax:

stsadm -o enablestsisapis

enumroles

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

Required parameters

Optionalparameters

-url

<none>

Sample syntax:

stsadm -o enumroles -url <URL>

enumsites

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

Required parameters

Optionalparameters

-url

<none>

Sample syntax:

stsadm -o enumsites -url <URL>

enumsubwebs

Lists thesubsites that have been created under a particular site.

Required parameters

Optionalparameters

-url

<none>

Sample syntax:

stsadm -o enumsubwebs -url <URL>

enumtemplates

Lists thesite templates that are available.

Requiredparameters

Optional parameters

<none>

-lcid

Sample syntax:

stsadm.exe -o enumtemplates [-lcid <language>]

enumusers

Lists the users of aparticular site or subsite.

Requiredparameters

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

Optionalparameters

<none>

-name

-url

Sample syntax:

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

extendvs

Extends a virtual server with and creates a new contentdatabase.

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

Required parameters

Optional parameters

-url

-ownerlogin

-owneremail

-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> [-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 for use in a server farm. Thisoperation does not create a new content database, but allows you to connect toan existing virtual server ( vsname ) and use the same contentdatabase.

Required parameters

Optional parameters

-url

-vsname

-apcreatenew

-apidname

-apidtype

-apidlogin

-apidpwd

Sample syntax:

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

getadminport

Returns theadministration port for .

Requiredparameters

Optional parameters

<none>

<none>

Samplesyntax:

stsadm -o getadminport

getproperty

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

Required parameters

Optionalparameters

-propertyname (pn)

-url

Sample syntax:

stsadm -o getproperty -pn <property name> [-url <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

Optionalparameters

-servicename

-setting

<none>

Samplesyntax:

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

renameweb

Renames thespecified subsite.

Requiredparameters

Optional parameters

-url

-newname

 

Samplesyntax:

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

restore

Restores a Web site froma backup file. Use the overwrite parameter to replace anyexisting Web site at the new location.

Requiredparameters

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. Use the ssl parameter to specify a Secure SocketsLayer (SSL) connection to the port. Use the admap... parameters to specify the IIS application pool to use or to create a new IISapplication pool for the administration virtual server.

Required parameters

Optionalparameters

-port

-ssl

-admapcreatenew

-admapidname

-admapidtype

-admapidlogin

-admapidpwd

Samplesyntax:

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 theconfiguration database or specifies the connection to an existing configurationdatabase. Setting the configuration database is required before a virtualserver can be extended.

Requiredparameters

Optional parameters

-databaseserver (ds)

-connect

-databaseuser (du)

-databasepassword (dp)

-databasename (dn)

-hh

-adcreation

-addomain

-adou

Samplesyntax:

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 thespecified property with the specified value. Use the url property to specify a virtual server or site collection to apply the propertyto, or omit the url parameter to apply the property at theserver or server farm level. For a list of valid properties, see Command-Line Properties .

Requiredparameters

Optional parameters

-propertyname (pn)

-propertyvalue (pv)

-url

Samplesyntax:

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 mustbe used.

Required parameters

Optional parameters

-url

either -ownerlogin or -secondownerlogin

 

Sample syntax:

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

unextendvs

Removesfrom a particular virtual server. Use the deletecontent parameter to delete the content databases for the virtual server.

Required parameters

Optionalparameters

-url

-deletecontent

Sample syntax:

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

uninstall

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

Requiredparameters

Optional parameters

<none>

-deletecontent

Sample syntax:

stsadm.exe -o uninstall [-deletecontent]

upgrade

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

Required parameters

Optional parameters

<none>

-url

Sample syntax:

stsadm.exe -o upgrade [-url <url>]

userrole

Specifies the sitegroup membership for a user. Use the add and delete parametersto specify whether to add the user to a site group or remove the user from asite 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]