SPSiteCollection.Add method (String, String, String, UInt32, Int32, String, String, String, String, String, String, String)

SharePoint 2013

Creates an SPSite object in the collection based on the specified URL, title, description, locale identifier (LCID), compatibility level and site definition or site template, as well as on the user names, user display names, and e-mail addresses of both the collection owner and a secondary contact.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public SPSite Add(
	string siteUrl,
	string title,
	string description,
	uint nLCID,
	int compatibilityLevel,
	string webTemplate,
	string ownerLogin,
	string ownerName,
	string ownerEmail,
	string secondaryContactLogin,
	string secondaryContactName,
	string secondaryContactEmail
)

Parameters

siteUrl
Type: System.String

A string that contains the server-relative URL for the site object (for example, Site_Name or sites/Site_Name).

title
Type: System.String

A string that contains the e-mail address of the owner of the site object.

description
Type: System.String

A string that contains the description for the site object.

nLCID
Type: System.UInt32

An unsigned 32-bit integer that specifies the LCID for the site object.

compatibilityLevel
Type: System.Int32

An 32-bit integer that represents the site compatibility level, e.g. 14 or 15

webTemplate
Type: System.String

A string that specifies the site definition or site template for the site object. Specify null to create a site without applying a template to it. For a list of default site definitions, see Remarks.

ownerLogin
Type: System.String

A string that contains the user name of the owner of the site object (for example, Domain\User). In Active Directory Domain Services account creation mode, the strOwnerLogin parameter must contain a value even if the value does not correspond to an actual user name.

ownerName
Type: System.String

A string that contains the display name of the owner of the site object.

ownerEmail
Type: System.String

A string that contains the e-mail address of the owner of the site object.

secondaryContactLogin
Type: System.String

A string that contains the user name of a secondary contact for the site object (for example, Domain \User).

secondaryContactName
Type: System.String

A string that contains the display name of a secondary contact for the site object.

secondaryContactEmail
Type: System.String

A string that contains the e-mail address of a secondary contact for the site object.

Return value

Type: Microsoft.SharePoint.SPSite
An SPSite object that represents the new site collection.
Show: