SharePoint 2013: how create host named site collection in C#

In C# you can create a hosted named site collection in C# using the method SPSiteCollection.Add in the overload reported in the link itself.

The two options (with PowerShell too) are described in Host-Named Site Collections (Provisioning by Code and in Specific Content Database).

Considerations about the rights needed from the user (eventually the app pool user with RunWith ElevatedPrivileges) to create site collection can be found in Custom SharePoint 2007 Site Collection Creation Page.

Add comment