Create Sites with STSADM
Creating sites is something administrators usually do from the Site Actions menu in SharePoint. This is easy and intuitive and for creating a few sites now and then it works very well. However, if you're setting up many sites or site collections frequently you know that it takes some time to do this with the GUI in SharePoint. If you're one of those people that don't do any work that you don't absolutely have to (like myself…), this post might be useful for you.
Create multiple Sites
First, let's create a few sites using the createweb command. I use a bat-file for this to make the work reusable.
- Create a bat-file with the following commands:
stsadm -o createweb -url http://toursrv/SalesTeamSite -sitetemplate STS#0 -title "Sales Team Site"
-description "This is the Team Site for the Sales Team"
From here it's easy to just copy the first command and change the properties.
stsadm -o createweb -url http://toursrv/FinanceTeamSite -sitetemplate STS#0 -title "Finance Team Site"
-description "This is the Team Site for the Sales Team"
stsadm -o createweb -url http://toursrv/HRTeamSite -sitetemplate STS#0 -title "HR Team Site"
-description "This is the Team Site for the Sales Team"
stsadm -o createweb -url http://toursrv/ITTeamSite -sitetemplate STS#0 -title "IT Team Site"
-description "This is the Team Site for the Sales Team"
stsadm -o createweb -url http://toursrv/SupportTeamSite -sitetemplate STS#0 -title "Support Team Site"
-description "This is the Team Site for the Sales Team"
pause
Some clarifications
-sitetemplate STS#0 is the Team Site template. The other default site templates are:
- STS#1: Blank Site
- STS#2: Document Workspace
- MPS#0: Basic Meeting Workspace
- MPS#1: Blank Meeting Workspace
- MPS#2: Decision Meeting Workspace
- MPS#3: Social Meeting Workspace
- MPS#4: Multipage Meeting Workspace
- BLOG#0: Blog
- WIKI#0: Wiki Site
(You can use custom templates such as those from the Fantastic 40 bundle as well. These are just the built-in templates)
When it's finished, click view All Site Content and review your sites.