Early this week on site deploying SharePoint 2010, the client wanted to create few site collections for their development team. He tried to create using the Central Administration and could not see any options for creating SharePoint site collections in their own databases!
Well, that’s not news to all of us in the SharePoint World! Is it?
It’s back to the command line to create a SharePoint site collection in it’s own database, just like the good old SharePoint 2007 days! The only big change for good being SharePoint 2010 Management Shell aka Windows PowerShell and no more STSADM.
So here we go –
You need to create a new content database for the web application and then you create a new site collection in that content database.
$w = get-spwebapplication
New-SPContentDatabase "DemoContentDB" -DatabaseServer "SQL\SERVER" -WebApplication $w
New-SPSite http://justsharepoint.com/teams/demo -OwnerAlias justsharepoint\alpesh -Name "Demo Site" -Template "STS#0"
Teams is a managed path
Template is the default Team Site
Database Server SQL
Database Instance SERVER
That’s it! One more small script to add to my arsenal of PowerShell scripts, as I keep learning bits of this powerful method to deploy and manage SharePoint 2010.
I have few short PowerShell scripts – that I hope to share in the days to come. Feedback and comments [especially on PowerShell or otherwise] always welcome!
Before I signoff, don’t forget to sign up for the newsletter to go into the raffle to win a SharePoint 2010 book!