1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Need to block a site in Vista A.S.A.P

Discussion in 'Web & Email' started by pete8811, Sep 7, 2007.

Thread Status:
Not open for further replies.
  1. pete8811

    pete8811 Thread Starter

    Aug 4, 2007
    What settings in vista do i need to configure via browser or whatever, to stop someone surfing a website instead of working?
  2. pete8811

    pete8811 Thread Starter

    Aug 4, 2007
    ' This script creates a new URL set in the URLSets collection of the firewall,
    ' adds sites to the URL set, creates a new access rule, and adds the new URL set
    ' to the objects referenced in the URLSets property of the access rule.

    Sub AddRuleAndUrlSet()

    ' Define enumeration values.
    const fpcInclude = 0
    const fpcSpecifiedProtocols = 1

    ' Create the root obect.
    Dim root ' The FPCLib.FPC root object
    Set root = CreateObject("FPC.Root")

    'Declare the other objects needed.
    Dim firewall ' An FPCArray object
    Dim policyrules ' An FPCPolicyRules collection
    Dim urlsets ' An FPCURLSets colection
    Dim urlset ' An FPCURLSet object
    Dim newrule ' An FPCPolicyRule object

    ' Get references to the array object (firewall), the policy rules collection,
    ' and the URL sets collection.
    Set firewall = root.GetContainingArray
    Set policyrules = firewall.ArrayPolicy.PolicyRules
    Set urlsets = firewall.RuleElements.URLSets

    WScript.Echo "Creating a new URL set containing sites to be blocked ..."

    Set urlset = urlsets.Add("Blocked Web Sites")
    urlset.Add "http://www.northwindtraders.com"
    urlset.Add "http://www.widgets.com"

    WScript.Echo "Creating a new access rule ..."
    Set newrule = policyrules.AddAccessRule("Deny Access to Some Web Sites")

    ' Define the source for the new access rule.
    newrule.SourceSelectionIPs.Networks.Add "External", fpcInclude

    ' Add the new destination URL set to the objects referenced by the URLSets property
    ' of the new access rule.
    newrule.AccessProperties.URLSets.Add "Blocked Web Sites", fpcInclude

    'Set the protocols to HTTP and HTTPS.
    newrule.AccessProperties.SpecifiedProtocols.Add "HTTP", fpcInclude
    newrule.AccessProperties.SpecifiedProtocols.Add "HTTPS", fpcInclude
    newrule.AccessProperties.ProtocolSelectionMethod = fpcSpecifiedProtocols

    ' Set the user set to which the rule applies.
    newrule.AccessProperties.UserSets.Add "All Users", fpcInclude

    'Save the changes to the new access rule.
    WScript.Echo "Done!"

    End Sub

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/620991

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice