IPDeny

You can use the IPDeny property of the IIsIPSecurity object to edit lists of IP addresses, held in an array, that are not allowed access to the server.

Syntax

SecObj.IPDeny "IPAddress,SubnetMask"

 

Parameters
SecObj
An IIS Admin Object of type IIsIPSecurity.
IPAddress
This is a specific IP address you want to deny access to the server.

SubnetMask

This is the subnet mask for the specified IP address.

Code Example
<% 
  Dim SecObj 
  Dim MyIPSec
  Dim IPList, DomainList
  Set SecObj = GetObject("IIS://LocalHost/W3SVC/1") 
  Set MyIPSec = SecObj.IPSecurity
  'Test value of MyIPSec.GrantByDefault here.
  DomainList = MyIPSec.DomainDeny
  IPList = MyIPSec.IPDeny
  Redim IPList (Ubound(IPList)+1)
  IPList (Ubound(IPList)) = "123.0.0.1,255.255.255.0"
  Redim DomainList (Ubound(DomainList)+1)
  DomainList (Ubound(DomainList)) = "somedomain.com"
  IPSec.DomainDeny = DomainList
  IPSec.IPDeny = IPList
  Set SecObj.IPSecurity = MyIPSec
  DirOjb.Setinfo
%> 
 
See Also

IPGrant, DomainDeny, DomainGrant, GrantByDefault, IIsIPSecurity