DomainGrant

IIsIPSecurity 개체의 DomainGrant 속성을 사용하여 서버에 액세스가 허용된 도메인 목록을 편집할 수 있습니다.

구문

SecObj.DomainGrant = Domain

varDomainGrant = SecObj.DomainGrant

매개 변수

SecObj
IIsIPSecurity 형식의 IIS 관리 개체입니다.
Domain
서버에 대한 액세스를 허용할 도메인입니다.

코드 예

<%

' Remember to enable Integrated Windows Authentication and

' disable Anonymous Access or you will get and Server 500 error.

Dim SecObj

Dim MyIPSec

Dim DomainList

  
  ' 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=FALSE or your changes will not count

If (TRUE = MyIPSec.GrantByDefault) Then

Response.Write

"<BR>GrantByDefault was not FALSE. Setting to FALSE.<BR>"

MyIPSec.GrantByDefault = FALSE

End If

  

' Get the Grant list, as an array, and add your new allowed domain

DomainList = MyIPSec.DomainGrant

Redim DomainList (Ubound(DomainList)+1)

DomainList (Ubound(DomainList)) = "somedomain.com"

' Set the new lists back in the metabase in two stages, and then set

' the metabase

MyIPSec.DomainGrant = DomainList

SecObj.Setinfo

  

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

%>

 

관련 항목

IPDeny, IPGrant, DomainDeny, GrantByDefault, IIsIPSecurity


© 1997-2001 Microsoft Corporation. All rights reserved.