#Set variables
$sitename = "SOME SITE NAME"
$managedpathname = "MANAGED PATH NAME"
$contentdb = "Some_Content_Database"
$dbserver = "databaseserver_sql"
$webapp = "http://dev.sharepoint.com"
$siteurl = "http://dev.sharepoint.com/managedpath/sitename"
$feature = Get-SPFeature PublishingSite
$Template = STS#0
$Owner = "domain\username"
#Create the content database the new collection will live in
New-spcontentdatabase -name $contentdb -databaseserver $dbserver -webapplication $webapp
#Create the Managed Path, if needed. Often this line will be commented out, as is below
#new-spmanagedpath $managedpathname -webapplication http://dev.sharepoint.com
#Create the site collection in that content database
new-spsite -name $sitename -contentdatabase $contentdb -url $siteurl -owneralias $Owner -template $Template
#Set the content database to only allow that site collection to be built there
get-spcontentdatabase -site $siteurl | set-spcontentdatabase -maxsitecount 1 -warningsitecount 0
No comments:
Post a Comment