Fast Site Collection Creation in SharePoint 2016 using PowerShell

This SharePoint 2016 tutorial explains the fast site collection creation in SharePoint 2016 using PowerShell. The fast site collection creation process improves site collection creation performance.

SharePoint 2016 has various new features for developers.

Fast Site Collection Creation in SharePoint 2016

One of the new features of SharePoint 2016 is fast site collection creation feature.

Previously when you are trying to create SharePoint site collection it usually takes time to create a site collection. To reduce this performance issue, in SharePoint 2016 Microsoft provides the fast site collection feature which is supported now by PowerShell only.

You can create the fast site collection using PowerShell only because UI is not supported yet.

On a high level, this works at the SQL Server level which reduces round trips required between SharePoint and SQL Server. It simply copies at the SQL server level directly.

SharePoint 2016 provides few PowerShell commands to work with fast site creation.

Below are PowerShell cmdlets to work with Fast site Creation in SharePoint 2016.

Get-SPWebTemplatesEnabledForSiteMaster

This PowerShell command displays a list of template IDs that are enabled for SharePoint 2016 fast site creation.

PS E:\Users\Administrator> Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-SPWebTemplatesEnabledForSiteMaster 
NameCompatibilityLevel
SPSPERS#215
SPSPERS#615
SPSPERS#715
SPSPERS#815
SPSPERS#915
SPSPERS#1015

When you run the above command, you can see the templated ids enabled for fast site creation.

Enable-SPWebTemplateForSiteMaster

By using this PowerShell command you can enable a template for fast site collection creation in SharePoint 2016.

Suppose you want to enable team site template id for fast site collection creation, then you can use the below PowerShell command.

STS#0 is the template id for the team site. You can check a very good article by Vlad in Absolute-SharePoint to see all the template ids.

Enable-SPWebTemplateForSiteMaster -Template "STS#0" -CompatibilityLevel 15

Once you run the above command you can see the team site template is now enabled for fast site creation.

PS E:\Users\Administrator> Add-PSSnapin Microsoft.SharePoint.PowerShell
Enable-SPWebTemplateForSiteMaster -Template "STS#0" -CompatibilityLevel 15
Get-SPWebTemplatesEnabledForSiteMaster
NameCompatibilityLevel
SPSPERS#215
SPSPERS#615
SPSPERS#715
SPSPERS#815
SPSPERS#915
SPSPERS#1015
STS#015

Get-SPSiteMaster

This command will display the site master information, it is something like this information will be used when we create a site collection using a fast site creation process.

Get-SPSiteMaster -ContentDatabase WSS_Content

By default it will provide information like below when you run the above command:

PS E:\Users\Administrator> Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-SPSiteMaster -ContentDatabase WSS_Content

ContentDatabase          : SPContentDatabase Name=WSS_Content

SiteId                   : bb743227-37ac-404c-8ab3-e6e293313b38

TemplateName             : SPSPERS#10

Language                 : 1033

CompatibilityLevel       : 15

FeaturesToActivateOnCopy : {0ee1129f-a2f3-41a9-9e9c-c7ee619a8c33|00000000-0000-0000-0000-000000000000|;,

                           f661430e-c155-438e-a7c6-c68648f1b119|00000000-0000-0000-0000-000000000000|;,

                           e9c0ff81-d821-4771-8b4c-246aa7e5e9eb|00000000-0000-0000-0000-000000000000|;,

                           fa8379c9-791a-4fb0-812e-d0cfcac809c8|00000000-0000-0000-0000-000000000000|;…}

It looks like below:

sharepoint 2016 new feature fast site creation
sharepoint 2016 new feature fast site creation

New-SPSiteMaster

We can use this PowerShell command to new site master using any template. As for our requirement we will create a site master for the team site template.

New-SPSiteMaster -ContentDatabase WSS_Content -Template STS#0

This command will take some time to add to the site master. After this if you will run Get-SPSiteMaster PowerShell command you can see our team site template will be added to the site master like below:

PS E:\Users\Administrator> Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-SPSiteMaster -ContentDatabase WSS_Content

ContentDatabase          : SPContentDatabase Name=WSS_Content

SiteId                   : ab6df6d4-6b48-4a54-97a8-4dac0f23443c

TemplateName             : STS#0

Language                 : 1033

CompatibilityLevel       : 15

FeaturesToActivateOnCopy : {4c42ab64-55af-4c7c-986a-ac216a6e0c0e|00000000-0000-0000-0000-000000000000|;,

                           8581a8a7-cf16-4770-ac54-260265ddb0b2|00000000-0000-0000-0000-000000000000|;,

                           3bae86a2-776d-499d-9db8-fa4cdc7884f8|00000000-0000-0000-0000-000000000000|;,

                           3cb475e7-4e87-45eb-a1f3-db96ad7cf313|00000000-0000-0000-0000-000000000000|;…}

ContentDatabase          : SPContentDatabase Name=WSS_Content

SiteId                   : bb743227-37ac-404c-8ab3-e6e293313b38

TemplateName             : SPSPERS#10

Language                 : 1033

CompatibilityLevel       : 15

FeaturesToActivateOnCopy : {0ee1129f-a2f3-41a9-9e9c-c7ee619a8c33|00000000-0000-0000-0000-000000000000|;,

                           f661430e-c155-438e-a7c6-c68648f1b119|00000000-0000-0000-0000-000000000000|;,

                           e9c0ff81-d821-4771-8b4c-246aa7e5e9eb|00000000-0000-0000-0000-000000000000|;,

                           fa8379c9-791a-4fb0-812e-d0cfcac809c8|00000000-0000-0000-0000-000000000000|;…}

create site collection using powershell
create site collection using PowerShell

New-SPSite

Now we can create a site collection from site master in SharePoint 2016 by using the PowerShell command below:

New-SPSite http://mypc/sites/MyFastSiteFromPowerShell -ContentDatabase "WSS_Content" -CompatibilityLevel 15 -CreateFromSiteMaster -Template "STS#0" -OwnerAlias"MySP\Administrator"

This will create the site collection in less time.

New-SPSite CreateFromSiteMaster PowerShell SharePoint 2016
New-SPSite CreateFromSiteMaster PowerShell SharePoint 2016

You can visit the site url to see the site collection created successfully.

Fast site creation feature sharepoint 2016
Fast site creation feature SharePoint 2016

Disable-SPWebTemplateForSiteMaster

Microsoft also provides below command to disable site template from site master.

Disable-SPWebTemplateForSiteMaster -Template STS#0

The above command will disable team site template from site master.

Remove-SPSiteMaster

This PowerShell command will remove site master from the content database.

Remove-SPSiteMaster -ContentDatabase "WSS_Content" -SiteId

SiteId: You can get the SiteId by running Get-SPSiteMaster -ContentDatabase WSS_Content command.

You may like following SharePoint tutorials:

I hope this SharePoint 2016 tutorial helps to know about SharePoint 2016 Fast Site Collection Creation using PowerShell.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>