Managed Web Hosting::CreateCustomerWebSite

The CreateCustomerWebSite method creates and secures a Web site along with associated file directories and an FTP virtual directory for a specified customer. You can use this method in shared and dedicated environments.

Arguments

Input argument Required Description

<org>

Yes

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

<webServerName>

Yes

A string representing the name of the server. This can be a network basic input/output system (NetBIOS) name, a fully qualified domain name (FQDN), or an IP address.

<webRootShare>

Yes

The Universal Naming Convention (UNC) path to the root of the hosted Web site directory. This path must be accessible via the MPF server and the account that is submitting this request must have permissions to create directories on that share (for example, \\WEB01\WebHosting).

<webRootPath>

Yes

The full path to the root Web location. This should be the local path to the share provided in webRootShare (for example, "c:\WebHosting").

<serverBindings>/<binding>

Yes

One or more instances with attributes containing the components of a Web sites server bindings.

  • @ipAddress - Optional parameter that can be omitted or included as zero-length to represent "all unassigned."

  • @hostHeader - Optional parameter that can be zero-length or omitted.

  • @port - A required parameter.

Dd278507.note(en-us,TechNet.10).gifNote
If you omit or provide an invalid or NULL value for @port, the site will get created successfully but will not be able to be started until the error is corrected by an administrator.

<webSiteName>

Yes

The unique name for the Web site. Must be unique for the organization if the organization owns multiple Web sites. This named is used for easy lookup of the site.

<ftpSiteName>

Yes

The friendly-name of the FTP site that appears in ISM (for example, isolated FTP). This is the FTP site that will be used for the customers FTP VDir.

<preferredDomainController>

Yes

The name of the preferred domain controller.

<serverAutoStart>

Yes

The Web server will either be started or left in a stopped state depending on the value supplied. Allowed values are "0" which leaves the server in a stopped state, or "1" which starts the server.

<frontpageExtendWeb>

Yes

Allowed values are 1, which will install Frontpage extensions, or 0 which won't install the extensions. If 1 is specified and extensions are already installed an exception will not be thrown. If 0 is specified and extensions are not installed, an exception will be thrown.

<anonymousUserPass>

Yes

The password for the automatically generated anonymous user.

<allowChangeToLogFiles>

Yes

Specifies whether organization administrators should have write access to the log file directory and its contents. If set to "1", write access is granted. If set to "0" write access is denied.

<webDirName>

No

If you use this element, it will be the name of the Web directory structure that is created for the site. Otherwise, the value of <webSiteName> will be used as the directory name.

<logDirName>

No

If you use this element, it will be the name of the log file directory that is created for the site. Otherwise, the default value of "logfiles" will be used.

<uncUserPass>

No

If you use this element, a user is created and set with this password. The resulting user is then applied to the UncUserName property for the Web site.

<properties>

No

The collection of the customer's root Web properties. Any valid property setting supported by the IIS provider can be passed through here. Typical properties would include:

  • AuthFlags - An optional integer. See the IIS documentation for legal values.

  • AppFriendlyName - An optional string. Defaults to "Default Application".

  • AppIsolated - An optional integer. Uses IIS default.

  • AppPoolId - An optional string. IIS 6.0 only. App Pool is created if it doesn't exist.

  • Path - A prohibited parameter. If present in the properties collection, an exception will be thrown regarding an invalid parameter.

  • AccessFlags - A prohibited parameter. If present in the properties collection, an exception will be thrown regarding an invalid parameter.

  • DefaultLogonDomain - An optional parameter. If not supplied the default value will be "\".

<serverComment>

No

This is the friendly-name for the new Web site and will appear in ISM (for example, www.contoso.com). If the element is not present, then the value of <webSiteName> will be used for this property.

Output argument Description

<IISPath>

The IIS Metabase path to the new Web site, for example IIS://WEB01/W3SVC/993.

<customerRootPath>

The customers root path, for example c:\websites\northwindtraders.

<customerRootShare>

The customer root share for example \\WEB01\websites$\northwindtraders.

<contentRootPath>

The customers content path (root of the web site), for example c:\websites\northwindtraders\web\content.

<siteRootShare>

The root for the Web sites content and log files, for example \\WEB01\websites$\northwindtraders\www.northwindtraders.com.

<IISFtpPath>

The IIS metabase path of the customer FTP site, for example IIS://WEB01/MSFTPSVC/1/root/northwindtraders.

<users>

The collection of auto-generated users.

Remarks

Process Steps

The following steps occur when creating a Web site with the CreateCustomerWebSite method of the Managed Web Hosting Namespace:

  1. Get the AllUsers and Admins groups for the organization.

  2. Make the group paths Primary Domain Controller (PDC)specific.

  3. Create the directory structure and apply appropriate access control lists (ACLs).

  4. Create the IIS Site.

  5. Ensure the existence of an application pool if specified in property collection.

  6. Create the service specific log directory and apply appropriate ACLs.

  7. Create a pointer in Active Directory directory service to the new site.

  8. Create the anonymous user.

  9. Create the UNC user if specified.

  10. Enable anonymous and UNC user.

  11. Set the passwords for the anonymous and UNC user accounts.

  12. Set otherWellKnownObjects for anonymous and UNC user accounts on the web site pointer.

  13. Extend the site with FrontPage extensions if specified.

  14. Create the Virtual Directory on the default FTP site, homed to the root of the customer site if it does not already exist.

  15. The site will start or not depending on the value of <serverAutoStart>.

Auto-Generated Accounts

For each Web site, auto-generated accounts are created as part of the transaction. An anonymous user account is always created and a UNC user account is optionally created. The accounts use the following naming convention:

  • W3SVC[IIS METABASE ID]_Anon@[OrganizationalUnit]

  • W3SVC[IIS METABASE ID]_UNC@[OrganizationalUnit]

The accounts are configured so that:

  • Passwords never expire.

  • The user can not change the password.

Directory Structure and Security

The following directory structure is implemented by the CreateCustomerWebSite method:

<webShareRoot> 
        | 
        +--northwindtraders (customer content root  - FTP Vdir root) 
        |               | 
        |               www.northwind.com 
        |               |       | 
        |               |       +-- web 
        |               |       |       | 
        |               |       |       +--content (customer web site root) 
        |               |       | 
        |               |       +-- logfiles (customer log file) 
        |               | 
        |               support.northwind.com 
        | 
        +--<customer02> 
        | 
        +--<customer03> 

Security

The CreateCustomerWebSite method has the following security requirements

  • The caller is impersonated.

  • The caller is tested for OrgCreator permissions by checking for membership in any of the following groups:

    • Domain Admins

    • Hosting Admins

    • Reseller Admins

Sample Code

Example XML Request

The following is an example of an XML request for the CreateCustomerWebSite method of the Managed Web Hosting Namespace:

<request> 
        <procedure> 
                <execute namespace="Managed Web Hosting"  
                procedure="CreateCustomerWebSite" impersonate="1"> 
                        <executeData> 
                        <preferredDomainController>AD01.fabrikam.com 
                        </preferredDomainController> 
                        <org>LDAP://OU=alpineskihouse,OU=consolidatedmessenger, 
                        OU=Hosting,DC=fabrikam,DC=Com 
                        </org> 
                        <webServerName>WEB01</webServerName> 
                        <webRootShare>\\WEB01\websites$</webRootShare> 
                        <webRootPath>C:\websites</webRootPath> 
                        <webSiteName>www.alpineskihouse.com</webSiteName> 
                        <ftpSiteName>isolatedFTP</ftpSiteName> 
                        <anonymousUserPass>Pass1Word</anonymousUserPass> 
                        <frontpageExtendWeb>0</frontpageExtendWeb> 
                        <serverAutoStart>1</serverAutoStart> 
                        <serverBindings> 
                        <binding port="80" ipAddress=""  
                         hostHeader="www.alpineskihouse.com" /> 
                        </serverBindings> 
                        <allowChangeToLogFiles>0</allowChangeToLogFiles> 
                        <properties> 
                        <property name="AppPoolId">AlpinePool</property> 
                        </properties> 
        </executeData> 
                        <after source="executeData" destination="data" mode="merge" /> 
                </execute> 
        </procedure> 
</request> 

Example XML Response

The following is an example of an XML response from the CreateCustomerWebSite method of the Managed Web Hosting Namespace:

<response> 
        <data> 
                <preferredDomainController>AD01.fabrikam.com 
                </preferredDomainController> 
        <org>LDAP://OU=alpineskihouse,OU=consolidatedmessenger, 
                OU=Hosting,DC=fabrikam,DC=Com</org> 
                <webServerName>WEB01</webServerName> 
                <webRootShare>\\WEB01\websites$</webRootShare> 
                <webRootPath>C:\websites</webRootPath> 
                <webSiteName>www.alpineskihouse.com</webSiteName> 
                <anonymousUserPass>Pass1Word</anonymousUserPass> 
                <uncUserPass>Pass1Word</uncUserPass> 
                <serverAutoStart>1</serverAutoStart> 
                <serverBindings> 
                <binding port="80" 
                        ipAddress="" 
                        hostHeader="www.alpineskihouse2.com"/> 
                </serverBindings> 
                <allowChangeToLogFiles>0</allowChangeToLogFiles> 
                <properties> 
                        <property name="AppPoolId">AlpinePool</property> 
                </properties> 
                <IISPath>IIS://WEB01/W3SVC/15192358</IISPath> 
                <customerRootPath>C:\websites\alpineskihouse</customerRootPath> 
                <customerRootShare>\\WEB01\websites$\alpineskihouse 
                </customerRootShare> 
                <contentRootPath> 
                c:\websites\alpineskihouse\www.alpineskihouse2.com\web\content 
                </contentRootPath> 
                <siteRootShare> 
                \\WEB01\websites$\alpineskihouse\www.alpineskihouse2.com 
                </siteRootShare> 
                <users> 
                <user owkName="WebAnonymousUser" 
                path="LDAP://cn=W3SVC15192358_Anon@alpineskihouse, 
                OU=alpineskihouse,OU=consolidatedmessenger,OU=Hosting, 
                DC=fabrikam,DC=Com" sAMAccountName="fabrikam\W3SVC15192358_Anon_A" 
                iisProperty="AnonymousUserName"/> 
                </users> 
                <IISFtpPath>IIS://WEB01/MSFTPSVC/331699149/root/alpineskihouse 
                </IISFtpPath> 
        </data> 
</response> 

Applies To

Managed Web Hosting Namespace API for:

  • Hosted Messaging and Collaboration version 4.5

  • Hosted Messaging and Collaboration version 4.0

  • 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

Managed Web Hosting::DeleteCustomerWebSite
Managed Web Hosting::ModifyCustomerWebSite
Managed Web Hosting::ControlCustomerWebSite