BindingElement Class1

Represents a binding element for a Web site.

Syntax

class BindingElement : CollectionElement  

Methods

This class contains no methods.

Properties

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.

Subclasses

This class contains no subclasses.

Remarks

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

Example

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  

Inheritance Hierarchy

CollectionElement

BindingElement

Requirements

Type Description
Client - IIS 7.0 on Windows Vista
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on Windows Server 2008
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
MOF file WebAdministration.mof

See Also

CollectionElement Class
SSLBinding Class
Site Class