IPDeny

IIsIPSecurity 개체의 IPDeny 속성을 사용하여 서버에 대한 액세스가 허용되지 않은 IP 주소 목록을 편집하고 배열을 유지할 수 있습니다.

구문

SecObj.IPDeny "IPAddress,SubnetMask"

varIPDeny = SecObj.IPDeny

매개 변수

SecObj
IIsIPSecurity 형식의 IIS 관리 개체입니다.
IPAddress
서버에 대한 액세스를 거부할 IP 주소입니다.
SubnetMask
지정한 IP 주소의 서브넷 마스크입니다.

코드 예

<% 
  ' Remember to enable Integrated Windows Authentication and 
  ' disable Anonymous Access or you will get and Server 500 error.
  Dim SecObj 
  Dim MyIPSec
  Dim IPList
  
  ' Get the IIS object that holds the info for the default site.  
  ' This could be any site root/vdir, or IIS://LocalHost/W3SVC for global  
  ' properties.
  Set SecObj = GetObject("IIS://LocalHost/W3SVC/1/Root") 
  
  ' Get the IIsIPSecurity object
  Set MyIPSec = SecObj.IPSecurity

  ' Make sure GrantByDefault=TRUE or your changes will not count  
  If (FALSE = MyIPSec.GrantByDefault) Then
    Response.Write 
  "<BR>GrantByDefault was not TRUE.  Setting to TRUE.<BR>"
    MyIPSec.GrantByDefault = TRUE
  End If

  ' Get the Deny list, as an array, and add your new restricted IP
  IPList = MyIPSec.IPDeny
  Redim IPList (Ubound(IPList)+1)
  IPList (Ubound(IPList)) = "123.0.0.1,255.255.255.0"
   
  ' Set the new lists back in the metabase in two stages, and then set   
  ' the metabase
  MyIPSec.IPDeny = IPList
  SecObj.IPSecurity = MyIPSec
  SecObj.Setinfo

  Response.Write "The IPRestriction has been set<BR>"

%>



관련 항목

IPGrant, DomainDeny, DomainGrant, GrantByDefault, IIsIPSecurity


© 1997-2001 Microsoft Corporation. All rights reserved.