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