[This is preliminary documentation and subject to change]
You can use the DomainDeny property of the IIsIPSecurity object to edit lists of domains that are not allowed access to the server.
SecObj.DomainDeny = Domain
VarDomainDeny = SecObj.DomainDeny
<%
' 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=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 domain
DomainList = MyIPSec.DomainDeny
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.DomainDeny = DomainList
SecObj.Setinfo
Response.Write "The IPRestriction has been
set<BR>"
%>
IPDeny, IPGrant, DomainGrant, GrantByDefault, IIsIPSecurity