Querying URL Categories in Forefront TMG

All of the URL categories for URL filtering that TMG is aware of are stored in TMG storage at the array level. Here’s an example script that queries for and returns all of the categories. Run the script on any TMG array member.

set root=CreateObject("FPC.Root")

For Each cat in root.GetContainingArray().RuleElements.UrlCategories

    wscript.echo "'" & cat.Name & "' --> " & cat.CategoryID


Alexey Doctorovich, Software Engineer on the TMG Team

(with Nathan Bigman, Content Publishing Manager)