Creating a Web site by using XML

Use the CreateWebSite procedure of the Managed IIS namespace to create a Web site.

This procedure expects to be called with impersonate="1". The procedure impersonates the caller.

Example of a request that calls the CreateWebSite procedure

<request>
  <procedure>
	<execute namespace="Managed IIS" procedure="CreateWebSite">
	<executeData>
		<description>www.ContosoHostHeaderWebSite.com</description>
		<diskMegabytes>40</diskMegabytes>
		<hostHeaderName>www.ContosoHostHeaderWebSite.com</hostHeaderName>
		<owner>LDAP://ou=Reseller,ou=Hosting,dc=contoso,dc=com</owner>
		<policyName>reseller</policyName>
		<StartOnCreate>1</StartOnCreate>
		<preferredDomainController>myPrimaryDC.contoso.com </preferredDomainController>
	</executeData>
	<after source="executeData" sourcePath="IISPath" destination="data" />
   </execute>
 </procedure>
</request>

Input for CreateWebSite

The following input is valid for this request:

Typical response for CreateWebSite

The procedure returns the Internet Information Services (IIS) path of the new Web site in the <IISPath> element. A typical response is shown in this example.

<response>
	<data>
		<IISPath>IIS://MyServer/W3SVC/5</IISPath>
	</data>
</response>

Important