SPSiteCollection.Add Method (String, String, String, UInt32, String, String, String, String, String, String, String, Boolean) (Microsoft.SharePoint.Administration)
Creates an SPSite object in the collection based on the specified URL, title, description, locale identifier (LCID), 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)
Syntax

Visual Basic (Declaration)
Public Function Add ( _
    siteUrl As String, _
    title As String, _
    description As String, _
    nLCID As UInteger, _
    webTemplate As String, _
    ownerLogin As String, _
    ownerName As String, _
    ownerEmail As String, _
    secondaryContactLogin As String, _
    secondaryContactName As String, _
    secondaryContactEmail As String, _
    useHostHeaderAsSiteName As Boolean _
) As SPSite
Visual Basic (Usage)
Dim instance As SPSiteCollection
Dim siteUrl As String
Dim title As String
Dim description As String
Dim nLCID As UInteger
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 useHostHeaderAsSiteName As Boolean
Dim returnValue As SPSite

returnValue = instance.Add(siteUrl, title, description, nLCID, webTemplate, ownerLogin, ownerName, ownerEmail, secondaryContactLogin, secondaryContactName, secondaryContactEmail, useHostHeaderAsSiteName)
C#
public SPSite Add (
    string siteUrl,
    string title,
    string description,
    uint nLCID,
    string webTemplate,
    string ownerLogin,
    string ownerName,
    string ownerEmail,
    string secondaryContactLogin,
    string secondaryContactName,
    string secondaryContactEmail,
    bool useHostHeaderAsSiteName
)

Parameters

siteUrl

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

title

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

description

A string that contains the description for the site object.

nLCID

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

webTemplate

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

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

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

ownerEmail

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

secondaryContactLogin

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

secondaryContactName

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

secondaryContactEmail

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

useHostHeaderAsSiteName

true if the site collection is identified by the host header; false if it is identified by the relative path.

Return Value

An SPSite object that represents the new site collection.
Remarks

The following table shows the values for the default site definitions that are included in an installation of Windows SharePoint Services.

Value

Site Definition

STS#0

Team Site

STS#1

Blank Site

STS#2

Document Workspace

MPS#0

Basic Meeting Workspace

MPS#1

Blank Meeting Workspace

MPS#2

Decision Meeting Workspace

MPS#3

Social Meeting Workspace

MPS#4

Multipage Meeting Workspace

See Also

Tags :


Community Content

MollyBos - MSFT
Host Header as Site Name Paramater

Does anyone know what the "UseHostHeaderAsSiteName" does.  I saw this and thought that maybe this is a way to provide the functionality that MCMS 2002 had to map host header names to channels?  I would like to find that functionality in SharePoint 2007.  Does anyone know what this parameter is for?  Is my assumption right?


Response :  This isn't the right place for questions; please post questions to the MSDN Forums, at http://forums.microsoft.com/msdn , instead.  If you get a useful response, you can post that info here in the community content section.  Thanks! 

 

Tags :

maxweber
useHostHeaderAsSiteName = true == UriFormatException
Just a word to the wise here, when using this method signature, any time that I would specify useHostHeaderAsSiteName = true, I would always get a UriFormatException. I don't know what it's really supposed to do but I can't think of why it would cause this weird behavior. The good news, at least for what I was trying to do, is that setting this to false was functionally equivalent to the "true" version, except it didn't throw an exception and created my site collection how it was supposed to.
Tags :

Thomas Lee
Description of Title is incorrect
The decription of the title parameter is not correct.
Tags : contentbug

Page view tracker