Scripting URL overrides in Forefront TMG

You can use Forefront TMG scripting capabilities to allow non-TMG administrators to locally override a URL (enabling advanced help-desk scenarios). Here’s a script snippet that demonstrates adding www.contoso.com/* to the Anonymizers category:

set fpc = CreateObject("FPC.Root")

set arr = fpc.GetContainingArray

set overrides = arr.ArrayPolicy.WebProxy.UrlFilteringSettings.OverridingUrlCategories

overrides.Add "www.contoso.com/*", 2

arr.save

 

As you can see, the Add method takes the Category ID (the number 2, representing Anonymizers) as a parameter. Here’s a list of the Category IDs:

         1        Alcohol 

         2        Anonymizers 

         3        Art/Culture/Heritage 

         4        Blogs/Wiki 

         5        Botnet 

         6        Chat 

         7        Child Friendly Materials 

         8        Criminal Activities 

         9        Dating/Personals 

        10       Digital Postcards 

        11       Dubious 

        12       Edge Content Servers/Infrastructure 

        13       Education/Reference 

        14       Employment 

        15       Fashion/Beauty 

        16       Financial 

        17       Forum/Bulletin Boards 

        18       Free Hosting 

        19       Gambling 

        20       Games 

        21       General Business 

        22       General Entertainment 

        23       Government/Military 

        24       Hacking/Computer Crime 

        25       Hate/Discrimination 

        26       Health 

        27       Humor/Comics 

        28       Illegal Drugs 

        29       Internet Services 

        30       Legal Services & Reference 

        31       Lifestyle Choices 

        32       Malicious 

        33       Mature Content

        34       Media Sharing

        35       Motor Vehicles

        36       News

        37       Non-Profit/Advocacy/NGO

        38       Nudity

        39       Obscene/Tasteless

        40       Online Communities

        41       Online Trading/Brokerage

        42       P2P/File Sharing

        43       Parked Domain

        44       Personal Network Storage

        45       Phishing

        46       Politics/Opinion

        47       Pornography

        48       Portal Sites

        49       Public Information

        50       Real Estate

        51       Recreation/Hobbies

        52       Religion/Ideology

        53       Remote Access

        54       Restaurants/Dining

        55       School Cheating Information

        56       Search Engines

        57       Self Defense

        58       Shareware/Freeware

        59       Shopping

        60       Social Opinion

        61       Spam URLs

        62       Sports

        63       Spyware/Adware

        64       Streaming Media

        65       Technical Information

        66       Tobacco

        67       Travel

        68       Usenet News

        69       Violence

        70       Weapons

        71       Web Ads

        72       Web E-mail

        73       Web Phone

        74       Web-based Productivity Applications

 

You can download the Forefront TMG SDK here.

 

Eric Detoc, ISA Escalation Engineer

Nathan Bigman, Content Publishing Manager