﻿<?xml version="1.0" encoding="UTF-8"?>
<!--RSS generated by Microsoft SharePoint Foundation RSS Generator on 5/21/2012 5:12:41 AM -->
<?xml-stylesheet type="text/xsl" href="/_layouts/RssXslt.aspx?List=8b645553-b1e3-4f1e-8c98-926705031332" version="1.0"?>
<rss version="2.0">
  <channel>
    <title>My blog: Posts</title>
    <link>http://blog.wauwwie.nl/Lists/Posts/AllPosts.aspx</link>
    <description>RSS feed for the Posts list.</description>
    <lastBuildDate>Mon, 21 May 2012 03:12:41 GMT</lastBuildDate>
    <generator>Microsoft SharePoint Foundation RSS Generator</generator>
    <ttl>60</ttl>
    <language>en-US</language>
    <image>
      <title>My blog: Posts</title>
      <url>http://blog.wauwwie.nl/_layouts/images/siteIcon.png</url>
      <link>http://blog.wauwwie.nl/Lists/Posts/AllPosts.aspx</link>
    </image>
    <item>
      <title>TunnelPortRanges and OverloadDefinitions</title>
      <link>http://blog.wauwwie.nl/Lists/Posts/ViewPost.aspx?ID=4</link>
      <description><![CDATA[<div><b>Body:</b> <div class="ExternalClass0C328DCD44694F7AA351841A58BF921E"><p>Just the other day, someone desired to add a tunnelport range to the TMG proxy, but did not know how to.<br />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.<br />Actually it was quite simple! 
</p><p>First start a PowerShell session and connect to the TMG array configuration (also works with ISA). 
</p><p style="margin-left:36pt"><span style="color:#4f81bd;font-family:Consolas;font-size:9pt">$tmg <strong>= </strong>new-object -comobject fpc.root<br />$a = $tmg.Arrays | ? { $_.name -eq &quot;ArrayName&quot;} </span><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p>Then &quot;browse to the WebProxy TunnelportRanges&quot; using [Tab] and &quot;.&quot;, add the configuration and save. 
</p><p style="margin-left:36pt"><span style="color:#4f81bd;font-family:Consolas;font-size:9pt">$a.ArrayPolicy.WebProxy.TunnelPortRanges.AddRange(&quot;SSL 8443&quot;,8443,8443)<br />$a.ArrayPolicy.WebProxy.TunnelPortRanges.save() </span><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p>Check the current configuration. 
</p><div><table style="border-collapse:collapse;background:#012456" border="0"><colgroup><col style="width:410px" /></colgroup><tbody valign="top"><tr style="height:114px"><td valign="middle" style="padding-top:1px;padding-left:7px;padding-bottom:1px;padding-right:7px"><p><span style="color:#eeedf0;font-family:Consolas;font-size:9pt"><strong>PS</strong>&gt; $a.ArrayPolicy.WebProxy.TunnelPortRanges | <strong>ft</strong>
								<em>–a<br /></em><br />Name     TunnelLowPort TunnelHighPort<br />---      ------------- --------------<br />NNTP               563            563<br />SSL                443            443<br />SSL 8443          8443           8443</span></p></td></tr></tbody></table></div><p>       
 </p><p>You also check the &quot;Change Tracking&quot; in TMG to see if the TunnelPortRange has been added. 
</p><p><img src="/Lists/Photos/TMG_ChangeTrack.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p>
 </p><p>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 &quot;OverloadDefinitions&quot;, and it works most of the time: 
</p><div><table style="border-collapse:collapse;background:#012456" border="0"><colgroup><col style="width:569px" /></colgroup><tbody valign="top"><tr style="height:53px"><td valign="middle" style="padding-top:1px;padding-left:7px;padding-bottom:1px;padding-right:7px"><p><span style="color:#eeedf0;font-family:Consolas;font-size:9pt">PS&gt; $a.ArrayPolicy.WebProxy.TunnelPortRanges.AddRange.OverloadDefinitions<br />IFPCTunnelPortRange AddRange (string, int, int)</span></p></td></tr></tbody></table></div><p><span style="font-family:Times New Roman;font-size:12pt"> </span>Just add <span style="color:#4f81bd"><span style="font-family:Consolas;font-size:9pt">.overloaddefinitions</span>
		</span>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. 
</p><p>Easy isn't it? 
</p><p>       
 </p><p>...and then the other question of the day. How to remove a TunnelPortRange, because someone made a typing error. 
</p><p>Luckily there is a<span style="font-family:Times New Roman;font-size:12pt">
		</span><span style="color:#4f81bd"><span style="font-family:Consolas;font-size:9pt">$a.ArrayPolicy.WebProxy.TunnelPortRanges.remove(&quot;Name of range to remove&quot;)</span><span style="font-family:Times New Roman;font-size:12pt">
			</span></span>and <span style="color:#4f81bd"><span style="font-family:Consolas;font-size:9pt">.save()</span><span style="font-family:Times New Roman;font-size:12pt">
			</span></span>it again to remove the TunnelPortRange.<span style="font-family:Times New Roman;font-size:12pt">
		</span></p></div></div>
<div><b>Category:</b> <a onclick="OpenPopUpPage('http://blog.wauwwie.nl/_layouts/listform.aspx?PageType=4&ListId={AC749430-186B-4B7F-B7C6-E938C558637D}&ID=4&RootFolder=*', RefreshPage); return false;" href="http://blog.wauwwie.nl/_layouts/listform.aspx?PageType=4&ListId={AC749430-186B-4B7F-B7C6-E938C558637D}&ID=4&RootFolder=*">Powershell</a>; <a onclick="OpenPopUpPage('http://blog.wauwwie.nl/_layouts/listform.aspx?PageType=4&ListId={AC749430-186B-4B7F-B7C6-E938C558637D}&ID=3&RootFolder=*', RefreshPage); return false;" href="http://blog.wauwwie.nl/_layouts/listform.aspx?PageType=4&ListId={AC749430-186B-4B7F-B7C6-E938C558637D}&ID=3&RootFolder=*">TMG</a></div>
<div><b>Published:</b> 7/8/2011 5:59 PM</div>
]]></description>
      <author>wauwwie\marco</author>
      <category>Powershell; TMG</category>
      <pubDate>Fri, 08 Jul 2011 14:52:12 GMT</pubDate>
      <guid isPermaLink="true">http://blog.wauwwie.nl/Lists/Posts/ViewPost.aspx?ID=4</guid>
    </item>
  </channel>
</rss>
