Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand

Create Site Collection with New Managed Path, Content Database

Posted by Jean Paul on July 14, 2013

In this article I would like to share the PowerShell script which performs the following:

1. Create new content database

2. Create new managed path

3. Create new site collection

PowerShell Script

Following is the PowerShell Script which performs the same.

# Add Snapin

If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )


Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell


# Create Content Database

New-SPContentDatabase -name “DATABASE-NAME” -WebApplication “http://WEB-APP-URL”

# Create Managed Path

New-SPManagedPath -RelativeURL “path/subpath” -WebApplication “http://WEB-APP-URL” -Explicit

# Create Site Collection

New-SPSite http://WEB-APP-URL/path/subpath -OwnerAlias DOMAINuser -Name “Site Collection Title” -Template “STS#0” -ContentDatabase “DATABASE-NAME”


You can verify the new site using the URL:


You can verify new managed path through Central Administration >Main Page > Select web application > Managed Paths (toolbar item)


You can verify the new content database through Central Administration > Main Page > Manage Content Databases link.



The same PowerShell script will be added to PowerShell Repository.  Please give me some time to do it.


In this article we have explore the PowerShell script to create new site collection with new managed path & content database.  I hope this will be useful for site conversion activities.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s