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)

Comments (2)

  1. Bibbleq says:

    Interesting that you can get all this stuff out via vbscript, but shouldn't this sort of thing be in PowerShell by now?

    Does TMG even have a powershell provider?



  2. Frank says:

    How to script url override in enterprise? Since previus script has array scope:


Skip to main content