Share via


Windows-based Hosting::CreateCustomerSharepointSite

This procedure creates a Windows SharePoint Services site collection.

Arguments

Input Arguments Description

<orgLdapPath>

The Lightweight Directory Access Protocol (LDAP) path of the organization that will own the site.

<target>

The URL of the Windows SharePoint Services administration site.

<siteName>

The site name which has to be unique within the organization. Name of the pointer in step 2 below. It stores two values of target and site.

<site>

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.

<title>

A string that contains the display name of the site collection.

<description>

A string that contains a description for the site collection.

<lcid>

An integer that specifies the locale identifier (LCID) for the site collection.

<userPrincipalName>

user@org.com.

<ownerEmail>

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

<ownerName>

A string that contains the display name of the owner.

<preferredDomainController>

<webTemplate>

A string that contains the name of the site template to use for creating the site collection.

<sendCredentials>

Remarks

Method Syntax

public string   CreateCustomerSharepointSite( 
                                        string orgLdapPath, 
                                        string target,  
                                        string siteName,  
                                        string site, 
                                        string title, 
                                        string description, 
                                        string lcid, 
                                        string userPrincipalName, 
                                        string ownerEmail, 
                                        string ownerName, 
                                        string preferredDomainController, 
                                        string webTemplate, 
                                        bool sendCredentials) 

Sample Code

Example XML Request

No example XML request.

Example XML Response

<response> 
  <data> 
    <orgLdapPath>LDAP://OU=WingTipToys,OU=consolidatedmessenger,OU=Hosting,DC=fabrikam,DC=Com</orgLdapPath> 
    <target>https://WEB01-wh:8080</target> 
    <siteName>Imp1</siteName> 
    <site>https://web-01-wh</site> 
    <title>Title</title> 
    <description>Desc</description> 
    <LCID>1033</LCID> 
    <preferredDomainController>AD01-wh.fabrikam.com</preferredDomainController> 
    <webTemplate>sts#0</webTemplate> 
    <owner> 
      <userPrincipalName>tester@WingTipToys.com</userPrincipalName> 
      <email>adsf@asdf.com</email> 
      <name>tester dude</name> 
    </owner> 
  </data> 
</response> 

Typical C# Usage

//Get user name and password.                            
        string userName = this.Request.ServerVariables.Get("AUTH_USER"); 
        string pass = this.Request.ServerVariables.Get("AUTH_PASSWORD"); 
 
        //Set credentials.       
        objWS.PreAuthenticate = true; 
        objWS.Credentials = new NetworkCredential(userName,pass); 
        lblMsg.InnerHtml = mpsResponseHeaderLabel; 
 
        //Display response. 
        this.mpsResponse.DocumentSource = ""; 
response = objWS.CreateCustomerSharepointSite(orgLdapPath, target, siteName, site, title, description, lcid, owner, userPrincipalName, email, preferredDomainController, webTemplate, true); 
 
        // set the response XML to match the return from MPF 
        responseXml.LoadXml(response); 
        this.mpsResponse.Document = responseXml; 

Applies To

Managed Windows-based Hosting Web Service for:

  • Hosted Messaging and Collaboration version 3.5

  • Hosted Messaging and Collaboration version 3.0

  • Windows-based Hosting version 4.5

  • Windows-based Hosting version 4.0

  • Windows-based Hosting version 3.5

  • Windows-based Hosting for Applications version 1.0

See also

Tasks

Windows-based Hosting::DeleteCustomerSharepointSite
Windows-based Hosting::AddUsersToSharepointSiteRole
Windows-based Hosting::RemoveUsersFromSharepointSiteRole