Microsoft Internet Security and Acceleration Server 2000 |
The following portion of Visual Basic code modifies the schedule example shown in Add a Schedule by using the UnSet method of the FPCSchedule object. The schedule "Extended Work Hours" is changed so that it includes all hours of the day, but only the days Monday through Friday. This is done by unsetting the days Saturday and Sunday:
Dim objFPC As New FPCLib.FPC ' declare schedule collection Dim MySchedules As FPCSchedules ' declare schedule object Dim MySchedule As FPCSchedule ' get the schedule collection of the current array Set MySchedules = objFPC.Arrays.GetContainingArray.PolicyElements.Schedules ' find "Extended Work Hours" Set MySchedule = MySchedules("Extended Work Hours") ' remove Saturday and Sunday from the schedule MySchedule.Unset fpcSAT, fpcALL_DAY MySchedule.Unset fpcSUN, fpcALL_DAY ' save changes MySchedules.Save
Again, note that the changes will not be saved to persistent storage until the last line of code, where the Save method is called.
The topic, Configuring Destination Sets, shows the addition of a new set of forbidden destinations to the FPC destination sets collection. The next section, Restricting Site Access, shows how to restrict site access through a new site and content rule. The new site and content rule applies to both the schedule created in this example, and the forbidden sites added in the Configuring Destination Sets topic.