IIsIPSecurity 개체의 GrantByDefault 속성을 사용하여 서버 액세스를 지정할 방법을 설정할 수 있습니다. GrantByDefault는 기본적으로 일부를 제외하고 모든 액세스를 허용할 것인지, 아니면 거부할 것인지를 지정하는 Boolean 속성입니다. GrantByDefault가 TRUE이면 모든 IP 주소와 도메인이 서버에 액세스가 허용됩니다. 단, DomainDeny 및 IPDeny 메서드의 목록 항목은 예외입니다. GrantByDefault가 FALSE이면 모든 IP 주소와 도메인이 서버에 액세스가 거부됩니다. 단, DomainGrant 및 IPGrant 메서드의 목록 항목은 예외입니다.
SecObj.GrantByDefault Boolean
<%
' Remember to enable Integrated Windows Authentication and
' disable Anonymous Access or you will get and Server 500 error.
Dim SecObj
Dim MyIPSec
' 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
If (TRUE = MyIPSec.GrantByDefault) Then
Response.Write
"<BR>GrantByDefault was set to TRUE. Setting to FALSE.<BR>"
MyIPSec.GrantByDefault = FALSE
Else 'If (FALSE = MyIPSec.GrantByDefault) Then
Response.Write
"<BR>GrantByDefault was set to FALSE. Setting to TRUE.<BR>"
MyIPSec.GrantByDefault = TRUE
End If
' Set the info in the database
SecObj.IPSecurity = MyIPSec
SecObj.Setinfo
%>
IPDeny, IPGrant, DomainDeny, DomainGrant, IIsIPSecurity