Create Site Collection in New Content Database

In STSADM we had createsiteinnewdb. However, in PowerShell with SharePoint 2010 there is no equivalent command. Therefore, I put together a script that will prompt for server name, database name, site collection, owners and some other parameters to mimic this process. The script

 
 
 
 
 
3.5 Star
(8)
2,113 times
Add to favorites
SharePoint
10/18/2011
E-mail Twitter del.icio.us Digg Facebook
  • What about SQL authentication?
    2 Posts | Last post May 31, 2012
    • So, is there a way in the script to pass SQL credentials to the DB server?  We are using a local service account to manage SQL and would like to use this account to create the content databases. This script is assuming you are logged in as the DB creator.
      
      In stsadm, I would use a script that would do this.  It is as follows:
      
      stsadm.exe -o createsiteinnewdb -url http://portalurl.domain.com/sites/%1 -ownerlogin "domain\user.id" -owneremail "myemail@domain.com" -databaseuser "saUSID" -databasepassword "password" -databaseserver "servername" -databasename SP_%1 -title %1
    • You don't need to pass the SQL Credentials to the script as the dd-PSSnapin microsoft.sharepoint.powershell command will elevate the rights of the person running it to dbowner.