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
2,113 times
Add to favorites
E-mail Twitter 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 -ownerlogin "domain\" -owneremail "" -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.