IIS Site::DeleteSite

The DeleteSite procedure deletes a Web or FTP site and provides the option to move the content directory to an archive location.

Arguments

Input argument Required Description

<contentDir>

Yes

If this optional node is present, it specifies the source and destination of the content copying process.

<contentDir parentShare="">

Yes

The parent shared folder is the network accessible UNC path of the directory in which the site content will be kept. This shared folder must be accessible from the MPF server. This must be the same value that was used to create the website.

<contentDir archivePath="">

Yes

The archive path is the location to which the content is copied for archive purposes.

<key>

Yes

A required node that specifies the metabase key.

<key path="">

Yes

The IIS path of the Web or FTP site to delete.

It is important to ensure path points to a valid, appropriate and trusted location. See the security note in IIS Provisioning Security Considerations for more details.

<key type="">

Yes

The type attribute specifies the type of the object to be deleted. It will be IIsWebServer for websites and IIsFtpServer for FTP sites.

Remarks

Example Process Steps

The following is an example of the steps you can follow when deleting a website with the DeleteSite procedure of the IIS Namespace:

  • Save metabase information for the site into a text file and store in Content Path.

  • Rename the content path if requested.

  • Delete the website or FTP site.

Sample Code

Example XML Request

The following is an example of an XML request for the DeleteSite procedure:

<request> 
    <procedure> 
        <execute namespace="IIS Site" procedure="DeleteSite"  
         impersonate="1"> 
            <executeData> 
                <contentDir parentShare="\\WEB01\wwwShare\test"  
                 archiveShare="\\WEB01\wwwShare\testArchive"/> 
                <key path="IIS://WEB01/W3SVC/33" type="IIsWebServer"/> 
            </executeData> 
        </execute> 
    </procedure> 
</request> 

Example XML Response

No example XML response.

Applies To

IIS Site Namespace API 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

IIS Site::CreateSite

Concepts

IIS Site::ModifySite