Pages

Monday, July 6, 2009

Batch Script for creating Test Site Collections [MOSS 2007] (Developer)

As a SharePoint developer there may be an occasion that you wanted to quickly create a SharePoint Site Collections of all the basic templates and test something. You might get to it by having some one or in a spare time (not that we have any) give it a shot and start creating some sites. Well now that you have taken the time (pain) to do so, your server hits a problem (Believe me I have been experienced with random SharePoint development environment anomalies, that some took time to figure out and fix it or simply roll back-Yep I use VMWorkstation my favorite) . Gosh what do you do now? Wish you had backed up the DB (Ya you could have done that if it was a small DB). If not you had it all scripted it out.

Well, I had the very same need quite frequently and ended up writing a small (well rather long) batch script. This script will create all the site collections based on all the basic WSS 3.0 site templates. It even goes one level further by creating all set of template based site collections for each of the basic set of template root site collections.

Remember to upgrade the email id and the login on the following lines (line numbers 13 and 14 )

SET owneremail=OwnerEmail@YourDomain.com
SET ownerlogin=yourdomain\OwnerLogin

Click below to download the script file.

No comments: