This is the second of three STSADM posts we have planned. This post covers commands that were new between RTM and SP2.
Topics/Commands covered in this post:
stsadm -o renamesite
EX: stsadm -o renamesite -oldurl http://www.hhsitecol.com -newurl http://new.hhsitcol.org
In this screenshot, notice our host-named site collection is www.hhsitecol.com
After we run the command, the address will be updated. The second screenshot (below) shows a refresh of the site collection list after the command was run. As you can see the site collection has been renamed to new.hhsitecol.org.
-- See this about more for host named site collections:
stsadm -o mergecontentdbs
-url <URL name>
-sourcedatabasename <source database name>
-destinationdatabasename <destination database name>
1 - Analyze (default)
2 - Full database merge
3 - Read from file
[-filename] <file generated from stsadm -o enumsites>
-- This can be used to move a site collection from one content database to another, or all site collections from one content DB to another.
-- If you don't want to move all site collections, mergecontentdbs needs to read the sites from an xml file.
To create the xml file, you must first run stsadm -o enumsites and pipe the output to an xml file:
EX: Stsadm -o enumsites -url http://m4 > c:\sites.xml
Open the xml file you created and delete the lines for any sites you do not want to move. Also update the <Sites Count= tag to display the proper number of sites.
As you can see we have nine site collections in The M4_Content_2 database. We removed all sites out of sites.xml except the one we want to move, http://m4/sites/team. We have also updated the <Sites count> tag to be 1.
Now run the mergecontentdbs command.
EX: stsadm -o mergecontentdbs -url http://m4/ -sourcedatabasename m4_content_2 -destinationdatabasename m4_moss_content -operation 3 -filename c:\sites.xml
Now that we’ve run the command, you see that we have 1 site collection in M4_MOSS_Content. This is the 1 site that was listed in sites.xml (http://m4/sites/team)
WARNING: It is vital that backups are taken before this command is utilized. If you plan to run this operation for a site collection that is approaching 10gb (or larger), or in a farm during high traffic periods, please see the following KB http://support.microsoft.com/kb/969242.
stsadm -o setsiteuseraccountdirectorypath
-path <name of OU>
-url <URL name>
EX: stsadm -o setsiteuseraccountdirectorypath -url http://m4/sites/team -path "OU=Users,DC=Armory,DC=Local"
-- This is used to set peoplepicker to only search within a specified OU instead of all of AD.
-- By default, you can only specify an OU that is within the same domain as the MOSS servers. However, if you install Feb CU, then you can specify OUs in trusted domains. See KB 967612 (http://support.microsoft.com/default.aspx?scid=kb;EN-US;967612) for more on that.
stsadm -o setproperty
-propertyvalue <custom query string>
EX: stsadm -o setproperty -url http://m4/sites/team -pn peoplepicker-searchadcustomfilter -pv (firstname.lastname@example.org)
This allows you to set a custom filter to narrow your peoplepicker results. For example, you could have it return only users with the last name of "Roark".
-- This command will allow you to set invalid LDAP filters. Please validate your filters before using them.
-- To ensure good performance, you should only filter on attributes that are indexed within Active Directory. To return a list of indexed attributes, see KB 230662 (http://support.microsoft.com/kb/230662)
stsadm -o trimauditlog
-url <URL name>
-databasename <database name>
[-databaseserver] <database server name>
Origin: Infrastructure Update
EX: stsadm -o trimauditlog -date 20090315 -databasename m4_content_2 -databaseserver m4
-- Allows you to delete records from the auditdata table in the content database you specify. Previously the only supported way to purge the auditdata table was to run OM code. This was a problem since many administrators used auditing turned on for all the options on all of their sites, causing the auditdata table to grow to as much as a couple hundred million rows, causing database sizes to swell, and performance to decrease.
STSADM (Part I)