Tuesday, September 16, 2008

Creating multiple sites/webs using STSADM

CreateSites.bat

for /f "skip=1 tokens=1-4" %%a in (sites.txt) do @stsadm -o createsite -url http://server/sites/%%a -sitetemplate STS#1 -owneremail %%b -ownerlogin %%c -title %%d

for /f "skip=1 tokens=1-4" %%a in (webs.txt) do @stsadm -o createweb -url http://server/%%a -sitetemplate STS#1 -title %%d

pause
sites.txt
URL OwnersEmail OwnerLogin Title
Site01 administrator@company.com administrator SiteNo1
Site02 administrator@company.com administrator SiteNo2
Site03 administrator@company.com administrator SiteNo3
Site04 administrator@company.com administrator SiteNo4
Webs.txt
URL Title
Web01 WebName1
Web02 WebName2
Web03 WebName3
Web04 WebName4
Article:
http://www.robvanderwoude.com/ntfortokens.html
http://www.geocities.com/rick_lively/MANUALS/COMMANDS/F/FOR_F.HTM

0 comments: