Share via


SiteContainsApplication Class [IIS 7 and higher]

Provides a relationship between a Web site and its applications.

Syntax

class SiteContainsApplication : ObjectContainerAssociation

Methods

This class contains no methods.

Properties

The following table lists the properties exposed by the SiteContainsApplication class.

Name

Description

Container

(Inherited from ObjectContainerAssociation.) A read-only Site object that represents an IIS Web site. A key property.

Element

(Inherited from ObjectContainerAssociation.) A read-only Application object that represents an IIS application. A key property.

Subclasses

This class contains no subclasses.

Remarks

To implement this association, use the configuration API to enumerate the applications for a given site.

Example

The following example shows how to use the SiteContainsApplication class to retrieve all the applications in a Web site.

' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")

' Get the Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")

' Use the SiteContainsApplication class to return the set of
' application instances in the 'Default Web Site' Web site.
Set oApps = oSite.Associators_("SiteContainsApplication")
For Each oApp In oApps
    WScript.Echo oApp.Path 
Next

Inheritance Hierarchy

ObjectContainerAssociation

   SiteContainsApplication

Requirements

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

See Also

Reference

Application Class [IIS 7 and higher]

ObjectContainerAssociation Class [IIS 7 and higher]

Site Class [IIS 7 and higher]