' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = _
GetObject("winmgmts:root\WebAdministration")
' Get the IP security section for the default Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "IPSecuritySection", oSection
' Display the Path and Location properties.
WScript.Echo "=============================="
WScript.Echo "IP Security Section Properties"
WScript.Echo "=============================="
WScript.Echo "Path: " & oSection.Path
WScript.Echo "Location: " & oSection.Location
WScript.Echo
' Display the AllowUnlisted and
' EnableReverseDns properties.
WScript.Echo "AllowUnlisted: " & oSection.AllowUnlisted
WScript.Echo "EnableReverseDns: " & _
oSection.EnableReverseDns
WScript.Echo
' Display the IP and domain restrictions.
WScript.Echo "--------------------------"
WScript.Echo "IP and domain restrictions"
WScript.Echo "--------------------------"
For Each oIPAddressFilter In oSection.IpSecurity
WScript.Echo "IpAddress: " & oIPAddressFilter.IpAddress
WScript.Echo "DomainName: " & _
oIPAddressFilter.DomainName
WScript.Echo "SubnetMask: " & _
oIPAddressFilter.SubnetMask
WScript.Echo "Allowed: " & oIPAddressFilter.Allowed
WScript.Echo
Next