SPSiteCollection.Add method (SPSiteSubscription, String, String, String, UInt32, Int32, String, String, String, String, String, String, String, String, String, String, String)
Creates a new site in a new content database.
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Function Add ( _
siteSubscription As SPSiteSubscription, _
siteUrl As String, _
title As String, _
description As String, _
nLCID As UInteger, _
compatibilityLevel As Integer, _
webTemplate As String, _
ownerLogin As String, _
ownerName As String, _
ownerEmail As String, _
secondaryContactLogin As String, _
secondaryContactName As String, _
secondaryContactEmail As String, _
databaseServer As String, _
databaseName As String, _
userName As String, _
password As String _
) As SPSite
'Usage
Dim instance As SPSiteCollection
Dim siteSubscription As SPSiteSubscription
Dim siteUrl As String
Dim title As String
Dim description As String
Dim nLCID As UInteger
Dim compatibilityLevel As Integer
Dim webTemplate As String
Dim ownerLogin As String
Dim ownerName As String
Dim ownerEmail As String
Dim secondaryContactLogin As String
Dim secondaryContactName As String
Dim secondaryContactEmail As String
Dim databaseServer As String
Dim databaseName As String
Dim userName As String
Dim password As String
Dim returnValue As SPSite
returnValue = instance.Add(siteSubscription, _
siteUrl, title, description, nLCID, _
compatibilityLevel, webTemplate, _
ownerLogin, ownerName, ownerEmail, _
secondaryContactLogin, secondaryContactName, _
secondaryContactEmail, databaseServer, _
databaseName, userName, password)
public SPSite Add(
SPSiteSubscription siteSubscription,
string siteUrl,
string title,
string description,
uint nLCID,
int compatibilityLevel,
string webTemplate,
string ownerLogin,
string ownerName,
string ownerEmail,
string secondaryContactLogin,
string secondaryContactName,
string secondaryContactEmail,
string databaseServer,
string databaseName,
string userName,
string password
)
Parameters
siteSubscription
Type: Microsoft.SharePoint.SPSiteSubscriptionThe site subscription to add this new site to.
siteUrl
Type: System.StringA string that contains the server-relative URL for the site object (for example, Site_Name or sites/Site_Name).
title
Type: System.StringA string that contains the e-mail address of the owner of the site object.
description
Type: System.StringA string that contains the description for the site object.
nLCID
Type: System.UInt32An unsigned 32-bit integer that specifies the LCID for the site object.
compatibilityLevel
Type: System.Int32An 32-bit integer that represents the site compatibility level, for example, 14 or 15
webTemplate
Type: System.StringA string that specifies the site definition or site template for the site object. Specify a null reference (Nothing in Visual Basic) to create a site without applying a template to it. For a list of default site definitions, see Remarks.
ownerLogin
Type: System.StringA 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.StringA string that contains the display name of the owner of the site object.
ownerEmail
Type: System.StringA string that contains the e-mail address of the owner of the site object.
secondaryContactLogin
Type: System.StringA string that contains the user name of a secondary contact for the site object (for example, Domain \User).
secondaryContactName
Type: System.StringA string that contains the display name of a secondary contact for the site object.
secondaryContactEmail
Type: System.StringA string that contains the e-mail address of a secondary contact for the site object.
databaseServer
Type: System.StringA string that identifies the database server.
databaseName
Type: System.StringA string that contains the name for the new database that is created.
userName
Type: System.StringA string that contains the user name of the database administrator (for example, Domain\User).
password
Type: System.StringA string that contains the password for the database administrator.
Return value
Type: Microsoft.SharePoint.SPSite
An SPSite object that represents the new site collection.