TunnelPortRanges and OverloadDefinitions

Just the other day, someone desired to add a tunnelport range to the TMG proxy, but did not know how to.
I found out I needed to set this straight in the TMG array configuration. Luckily there are some tools available which can make the required change in the TMG array configuration. But it is way more fun doing it yourself.
Actually it was quite simple!

First start a PowerShell session and connect to the TMG array configuration (also works with ISA).

Then “browse to the WebProxy TunnelportRanges” using [Tab] and “.”, add the configuration and save.

Check the current configuration.

You also check the “Change Tracking” in TMG to see if the TunnelPortRange has been added.

tmg_changetrack

I got the question how I found out the correct input for the .AddRange. Although sometimes you got to keep your colleagues in the dark but this one is actually quite easy. It’s called the “OverloadDefinitions”, and it works most of the time:

Just add .overloaddefinitions after a method and it returns some info, some info is better than others. In this case it requires a text input, a number and another number. At least you know the correct input format and it is not hard to figure out the right context of this values.

Easy isn’t it?

 

…and then the other question of the day. How to remove a TunnelPortRange, because someone made a typing error.

Luckily there is a $a.ArrayPolicy.WebProxy.TunnelPortRanges.remove(“Name of range to remove”)and .save()it again to remove the TunnelPortRange.