This is the third of three STSADM posts.  This post covers new commands that have been release Post SP2.

STSADM (PART 1)
STSADM (PART 2)

Topics/Commands covered in this post: 
Enumallwebs
Preupgradecheck
Listqueryprocessoroptions
Setqueryprocessoroptions
VariationsFixuptool
Deletesite (Updated functionality)
Deleteweb (Updated functionality)
Backup (Updated Functionality)
Osearch (Updated functionality)+

New Commands

Enumallwebs

Syntax:

stsadm -o enumallwebs

   -databasename <database name>

   [-databaseserver <database server name>]

Usage: http://technet.microsoft.com/en-us/library/dd789634.aspx

This command outputs information about all webs in a content database. It can be useful for troubleshooting orphaned sites as it lists the webid and siteid for each web and whether or not the site exists in the sitemap table of the configuration database.

EX: stsadm -o enumallwebs -databasename M4_Content_1 -databaseserver M4 > webs.txt

23

Notes:

-- It's best to send the output to a text file as it can be hard to read in the command window.

-- In the screenshot above, notice the highlighted InSiteMap = "True". If this were "False" it's a good bet that this site is orphaned.

 

 

 

Preupgradecheck

Syntax:

stsadm -o preupgradecheck

   -[rulefiles <rule file name>]

   -[listrulefiles]

   -localonly

Usage: http://technet.microsoft.com/en-us/library/dd793605.aspx

This command is similar to the prescan command we had for upgrading from 2003 to 2007. It runs a series of checks to see if your system is ready to upgrade, to future versions, and outputs a summary to a handy .htm file in the default logs folder.

EX: stsadm -o preupgradecheck

24

Notes:

-- It's possible to create custom rule files in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\CONFIG\PreUpgradeCheck.


 

 

Listqueryprocessoroptions
Syntax:

stsadm -o listqueryprocessoroptions

   -ssp <SSP name>

Usage: http://technet.microsoft.com/en-us/library/dd789568.aspx

EX: stsadm -o listqueryprocessoroptions -ssp m4ssp

25

Notes:

-- This command just shows you your current query processor settings. It's useful when changing the settings via the new setqueryprocessoroptions command.

Setqueryprocessoroptions

Syntax:

stsadm -o setqueryprocessoroptions

   -ssp <SSP name>

   [-securitytrimmingcachesize <security trimming cache size>]

   [-securitytrimmingmultiplier <security trimming overfetch multiplier>]

   [-nearduplicatemultiplier <duplicate removal overfetch multiplier>]

   [-joinmultiplier <join discard overfetch multiplier>]

   [-sdidjoinmultiplier <missing security descriptor overfetch multiplier>]

Usage: http://technet.microsoft.com/en-us/library/dd789632.aspx

This command is useful in large farms where tweaking of the query service can increase search performance.

EX: stsadm -o setqueryprocessoroptions -ssp m4ssp -securitytrimmingcachesize 50000

26

Notes:

-- You can run listqueryprocessoroptions to make sure the change took.

-- You should take care when changing these values as they will impact the performance of your farm. Read the descriptions on http://technet.microsoft.com/en-us/library/dd789632.aspx before making any changes.

 

 

 

Old Commands that do new Stuff

Deletesite

Syntax:

stsadm -o deletesite

   -url <URL name>

   [-deleteadaccounts {True | False}]

   [-gradualdelete]

For deleting an orphaned site collection:

   -force

   [-gradualdelete]

   -siteid <site ID>

   -databasename <database name>

   -databaseserver <database server name>

Usage: http://technet.microsoft.com/en-us/library/cc261873.aspx

The -force parameter is new with SP2 and allows you to delete orphaned site collections. In order to run the command, you need the GUID for the site collection. You can get this from either running the enumallwebs command as described above and looking for any site collections where InSiteMap="False".

28

Now that you have the site GUID (Site Id) you can use it to remove the orphaned site.  Just run the deletesite command with the -force parameter, and specify that value for the -siteid parameter.

EX: stsadm -o deletesite -force -siteid 75599D94-9905-4120-84CE-47408A61ECDF -databasename m4_content_1 -databaseserver m4

 

--Note: the gradualdelete parameter was first introduced in the April 09 Cumulative Update.

 

 

Deleteweb

Syntax:

stsadm -o deleteweb

   -url <URL name>

For deleting a site within an orphaned site collection or an orphaned site within a site collection:

   -force

   -webid <Web ID>

   -databasename <database name>

   -databaseserver <database server name>

Usage: http://technet.microsoft.com/en-us/library/cc262877.aspx

The -force parameter is new with SP2 and allows you to delete orphaned webs in the same way you can delete orphaned sites with deletesite -force as shown above.

EX: stsadm -o deleteweb -force -webid 064d8e7b-b349-4693-bd67-dcefed3bf466 -databaseserver M4 -databasename M4_Content_1

31

Backup

Syntax:

For site collection backup

stsadm -o backup

   -url <URL name>

   -filename <file name>

   [-nositelock]

   [-overwrite]

For catastrophic backup

stsadm -o backup

   -directory <UNC path or local drive>

   -backupmethod <full or differential>

   [-force]

   [-item] <created path from tree>

   [-percentage] <integer between 1 and 100>

   [-backupthreads] <integer between 1 and 10>

   [-showtree]

   [-quiet]

Usage: http://technet.microsoft.com/en-us/library/cc263441.aspx

New for SP2 are the -force and the -nositelock parameters.

NoSiteLock:

Site collection backup -- Specifies that the site collection lock during a site collection backup is not set to read-only.

Force:

Farm (catastrophic) backup -- Ignores the disk space check and proceeds with the backup.

Osearch

Syntax:

stsadm -o osearch

   [-action]

   [-f] <suppress prompts>

   [-role] <index, query, or both>

   [-farmcontactemail] <e-mail address>

   [-farmperformancelevel] <indexing performance>

   [-farmserviceaccount] <account name>

   [-farmservicepassword] <password>

   [-defaultindexlocation] <directory>

   [-propagationlocation] <directory>

[-reprovisionindex]
[-cleansearchdatabase <true|false>]
[-ssp <ssp name>] required parameter for 'cleansearchdatabase' and 'reprovisionindex'

Usage: http://technet.microsoft.com/en-us/library/cc262920.aspx

In a farm with multiple SSPs, you can use the new osearch -reprovisionindex command to re-initialize the query servers for one of the SSPs while the other SSP continues to serve the query request.

EX: stsadm -o osearch -reprovisionindex -ssp M4SSP

32

Notes:

-- You will see the above result when you try to run this command on any server that is not a dedicated query server. In this case, the command was run on a box that was hosting the index and query roles.

 

STSADM (PART 1)

STSADM (PART 2)