Wednesday, 22 May 2013

SharePoint 2010: Create site collection using PowerShell script

This article is about how to create a site collection in SharePoint using PowerShell script

$WebApplicationURL="http://testsite"
$SiteCollectionName="Test Site"
$SiteCollectionURL="http://testsite/sites/test"
$SiteCollectionTemplate="STS#0"
$SiteCollectionLanguage="1033"
$SiteCollectionOwner="domain\loginname"
$ContentDatabaseName="TestDB"


1. Create a site collection with a separate content database

#Create a new content database
New-SPContentDatabase -Name $ContentDatabaseName -WebApplication $WebApplicationURL

# Create site collection using new content database
New-SPSite -URL $SiteCollectionURL -OwnerAlias $SiteCollectionOwner -Language $SiteCollectionLanguage -Template $SiteCollectionTemplate -Name $SiteCollectionName -ContentDatabase $ContentDatabaseName  

2. Create a site collection with the default content database

New-SPSite -URL $SiteCollectionURL -OwnerAlias $SiteCollectionOwner -Language $SiteCollectionLanguage -Template $SiteCollectionTemplate -Name $SiteCollectionName

Thats it !!!



1 comment:

  1. hi Ramesh I am getting issue in that can you please provide me some code examples

    ReplyDelete

SharePoint 2013: Video file URL from Asset Library

When you are working with Asset library in SharePoint 2013. It is very important to note that how video files are stored and managed in tha...