Microsoft Internet Security and Acceleration Server 2000

Modify a Site and Content Rule

The following portion of Visual Basic code modifies the new rule explained in the previous topic, Add a Site and Content Rule. The modification changes the rule to redirect the user to a specific URL after denying the request, rather than merely denying the request. This URL could contain, for example, the company policy toward accessing sports sites during work hours.

Dim objFPC As New FPCLib.FPC
' declare rules collection
Dim MySiteAndContentRules As FPCSiteAndContentRules
' declare rule object
Dim MySiteAndContentRule As FPCSiteAndContentRule
' get the rule collection of the current array
Set MySiteAndContentRules = objFPC.Arrays.GetContainingArray.ArrayPolicy.SiteAndContentRules
' find rule
Set MySiteAndContentRule = MySiteAndContentRules("Workday Site Restriction")
  ' change rule values here
  MySiteAndContentRule.RedirectUrl ""
  MySiteAndContentRule.Action = fpcRuleActionRedirect
' save your changes

See Also

FPCSiteAndContentRule Object