SharePoint2007Provider::CreateSite

This procedure creates a site collection on the specified server. This method supports rollback.

Arguments

Input Arguments Required Description

<target>

Yes

The URL of the Windows SharePoint Services administration site.

<site>

Yes

The absolute URL of the site to be created. This is the URL that a user would enter to access the site-for example, https://localhost/sites/sp, or https://spserver:81/sites/sp.

<ownerLogin>

Yes

The login name of the site's owner in the format DOMAIN/USER. The account must already exist.

<ownerEmail>

Yes

The e-mail address of the owner.

<ownerName>

Yes

The display name of the owner.

<title>

Yes

The display name of the site.

<description>

Yes

The description of the site.

<lcid>

Yes

The site's locale ID (system default culture if not supplied). Search MSDN for "Locale Code Table" for a list of codes.

<webTemplate>

No

The name of the site template to use when creating the site.

<hhUrl>

No

The optional string to specify a host header URL. If this parameter is specified, only the host portion of the 'site' parameter is used in site creation (The host portion is used to look up the web application that the site collection will be created under).

<org>

No

The distinguished name of the organization that owns the site.

Output Arguments Description

<siteGUID>

The globally unique identifier (GUID) of the site collection.

<subSiteGUID>

The GUID of the top level sub site.

Remarks

The caller must be a member of the local administrators group, or the group that is designated as the SharePoint Administrators Group Account.

The new site must be a sub-site of an Internet Information Services (IIS) Web site that already has already been extended for SharePoint.

A SharePoint site is created as a result of this call, not an IIS Web site or virtual directory.

To create the site collection, SPCA works in the following order:

Procedure Steps

  1. Create a site collection on the specified virtual server.

  2. Add the organization of site to SPSite.UserAccountDirectoryPath.

Security

We cannot set UserAccountDirectoryPath directly. SPSiteAdministration is used instead of SPSite.

Sample Code

Example XML Request

    <procedure> 
        <execute namespace="SharePoint2007Provider" procedure="CreateSite" 
                   impersonate="1"> 
            <executeData> 
                <target>https://raven003:8080</target> 
                <site>https://raven003</site> 
                <title>Test Site</title> 
                <description>Description of test site</description> 
                <ownerLogin>raven00\adminroys</ownerLogin> 
                <ownerName>roy s</ownerName> 
                <ownerEmail>someone@example.com</ownerEmail> 
                <lcid>1033</lcid> 
                <webTemplate>STS#0</webTemplate> 
                <org>OU=raven00,DC=frog,DC=com</org> 
                <hhUrl>https://www.raven003.com</hhUrl> 
            </executeData> 
        </execute> 
    </procedure> 
</request>

Example XML Response

<response> 
  <data> 
     <siteGUID>3F2504E0-4F89-11D3-9A0C-0305E82C3301</siteGUID> 
     <subSiteGUID>3F2504E0-4F89-11D3-9A0C-0305E3526892</subSiteGUID> 
  </data> 
</response> 

Applies To

SharePoint 2007 Provider for:

  • Hosted Messaging and Collaboration version 4.5

  • Hosted Messaging and Collaboration version 4.0

See also

Tasks

SharePoint2007Provider::DeleteSite
SharePoint2007Provider::GetSite