Click to Rate and Give Feedback

  Switch on low bandwidth view
IIS 7.0: BindingElement Class

Represents a binding element for a Web site.

class BindingElement : CollectionElement

This class contains no methods.

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

Name

Description

BindingInformation

A nonempty read/write string value with three colon-delimited fields that specify binding information for a Web site. The first field is a specific IP address or an asterisk (an asterisk specifies all unassigned IP addresses). The second field is the port number; the default is 80. The third field is an optional host header.

Protocol

A required unique nonempty read/write string value that specifies the protocol that the site binding uses. The default is "HTTP". The key property.

This class contains no subclasses.

Instances of this class are contained in the Bindings array property of the Site class.

The following example retrieves the bindings for all of the sites on a Web server.

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

' Get all Web site instances.
Set oSites = oWebAdmin.InstancesOf("Site")

' Display the name of each site and its bindings.
For Each oSite In oSites

    WScript.Echo oSite.Name

    For Each objItem in oSite.Bindings
        Wscript.Echo "Binding Info: " & objItem.BindingInformation
        Wscript.Echo "Protocol: " & objItem.Protocol
    Next
    WScript.Echo
Next

CollectionElement

   BindingElement

Type

Description

Client

Requires IIS 7.0 on Windows Vista.

Server

Requires IIS 7.0 on Windows Server 2008.

Product

IIS 7.0

MOF file

WebAdministration.mof

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker