<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="http://ideajam.net/ideajam/p/ij.nsf/rsstransform.xslt"?>
<rss version="2.0">
<channel>
	<language>en-us</language>
	<lastBuildDate>Sat, 25 May 2013 00:46:50 +0000</lastBuildDate>
	<title>IdeaJam(tm) : Automatic location switching - based on IP</title>
	<description>An RSS feed generated by IdeaJam(tm) for Automatic location switching - based on IP</description>
	<link>http://ideajam.net/ideajam/p/ij.nsf</link>
	<image>
	    <title>IdeaJam(tm) : Automatic location switching - based on IP</title>
	    <url>http://ideajam.net/ideajam/p/ij.nsf</url>
	    <link>http://ideajam.net/ideajam/p/ij.nsf/LogoSquare.gif?OpenImageResource</link>
	</image>
	<item>
		<pubDate>Wed, 09 Mar 2011 21:11:32 +0000</pubDate>
		<title>Notes Client / Core/Frameworks (Incl. sidebar, rich text editor): Automatic location switching - based on IP</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; Marcel Damseaux&lt;br&gt;&lt;b&gt;Tags:&lt;/b&gt;  &lt;a href="http://ideajam.net/IdeaJam/P/ij.nsf/ProductByCategory?openview&amp;restricttocategory=location document"&gt;location document&lt;/a&gt;  &lt;a href="http://ideajam.net/IdeaJam/P/ij.nsf/ProductByCategory?openview&amp;restricttocategory=location"&gt;location&lt;/a&gt;  &lt;a href="http://ideajam.net/IdeaJam/P/ij.nsf/ProductByCategory?openview&amp;restricttocategory=passthru"&gt;passthru&lt;/a&gt; &lt;br&gt;&lt;b&gt;Idea:&lt;/b&gt; 
&lt;div&gt;We use an Office location and an Internet location (which uses passthru servers in the DMZ with encrypted Notes ports), with different connection documents, so our users don't need to start/use a special VPN just to get to their mail.&lt;/div&gt;
&lt;div&gt;That means I have to switch to the Office location in the morning, and to the Internet location when I take my computer home every day.&lt;/div&gt;
&lt;div&gt;What I propose is that the locations can be linked to an IP address or subnet, so my client would switch/start automatically in the location document I have specified for that IP.&lt;/div&gt;
&lt;div&gt;That way our users in Notes would have same experience than the Oulook users we are migrating, and not to worry about those location documents anymore.&lt;/div&gt;
&lt;div&gt;This would be very similar to Sametime &amp;quot;Geographic locations&amp;quot;, it doesn't seem to be &amp;quot;rocket science&amp;quot;; in fact I have implemented it on a very rudimentary way with Lotusscript in minutes (launched at client startup via StartupDB=) and it works (but I need a native thing!).&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;- Stores location-ranges associations in notes.ini variable, like&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;$IPLocation=193.180.188.*,Internet;,Internet;192.168.1.*,Internet;10.2.42.*,Office (Network)&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;Sub LocationSwitcher&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;Dim session As New NotesSession&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;Dim workspace As New NotesUIWorkspace&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;iplocationarray=Split(session.GetEnvironmentString(&amp;quot;IPLocation&amp;quot;, False),&amp;quot;;&amp;quot;)&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;' Search the location to switch to&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;locationfound=&amp;quot;&amp;quot;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;myip=currentRange()&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;Forall iploc In iplocationarray&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;If Strleft(iploc,&amp;quot;,&amp;quot;) = myip Then&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;locationfound = Strright(iploc,&amp;quot;,&amp;quot;)&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;End If&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;End Forall&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;If locationfound&amp;lt;&amp;gt;&amp;quot;&amp;quot; Then&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;Print &amp;quot;Setting location according to range &amp;quot;+myip+&amp;quot;: &amp;quot;+locationfound&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;On Error Resume Next&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;Call workspace.SetCurrentLocation(locationfound)&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;On Error Goto 0&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;' pending - validate the location &lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;- if it doesn't exist present list &amp;nbsp;Call workspace.SetCurrentLocation(&amp;quot;Internet&amp;quot;)&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;is valid!&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;Else&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;Call workspace.SetCurrentLocation(&amp;quot;&amp;quot;)&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;' Store the location chosen for the future&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;location=Strleft(session.GetEnvironmentString(&amp;quot;Location&amp;quot;, True),&amp;quot;,&amp;quot;)&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;If iplocationarray(0)=&amp;quot;&amp;quot; Then&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;Call session.SetEnvironmentVar(&amp;quot;IPLocation&amp;quot;, myIP+&amp;quot;,&amp;quot;+location,False)&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;Else&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;Call session.SetEnvironmentVar(&amp;quot;IPLocation&amp;quot;, myIP+&amp;quot;,&amp;quot;+location+&amp;quot;;&amp;quot;+session.GetEnvironmentString(&amp;quot;IPLocation&amp;quot;, False),False) ' notice the new one is added at the begining so if exceeded string older are discarded&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;End If&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;End If&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;End Sub&lt;/div&gt;
&lt;div&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Function CurrentRange() As String&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;' This way also gets VPN address&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;allranges=&amp;quot;&amp;quot;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;Set IPConfigSet = GetObject(&amp;quot;winmgmts:{impersonationLevel=impersonate}&amp;quot;).ExecQuery (&amp;quot;select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE&amp;quot;)&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;Print &amp;quot;Getting IPs&amp;quot;, Now&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;Forall IPConfig In IPConfigSet&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;If Not Isnull(IPConfig.IPAddress) Then&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;For i=Lbound(IPConfig.IPAddress) To Ubound(IPConfig.IPAddress)&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;If IPConfig.IPAddress(i) &amp;lt;&amp;gt;&amp;quot;0.0.0.0&amp;quot; Then&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;CurrentRange=Strleftback(IPConfig.IPAddress(i),&amp;quot;.&amp;quot;)+&amp;quot;.*&amp;quot; ' return only one&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;Exit Function&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;End If&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;Next&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;End If&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;End Forall&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;CurrentRange=Fulltrim(allranges)&lt;/div&gt;
&lt;div&gt;End Function&lt;/div&gt;
&lt;/div&gt;&lt;br&gt;</description>
		<link>http://ideajam.net/ideajam/p/ij.nsf/0/A7CFD0B5D3C1A4998625784E007469D2?OpenDocument</link>
	</item>
	<item>
		<pubDate>Fri, 11 Mar 2011 03:24:07 +0000</pubDate>
		<title>re: Automatic location switching - based on IP</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; David Hablewitz&lt;br /&gt;&lt;b&gt;Comment:&lt;/b&gt; Clever. I know you can have multiple connection docs and Notes will try each until it finds a path and you can specify multiple IPs in one connection even. I would have to test it out again to be sure, but I don't think you need to switch locations at all to achieve your goal so long as you don't need a different location for the other settings, like mail file location. (For laptop users I set them to always work locally, even when they are in the office.)&lt;br /&gt;</description>
		<link>http://ideajam.net/ideajam/p/ij.nsf/0/A7CFD0B5D3C1A4998625784E007469D2?opendocument&amp;#commentsanc&amp;id=B6A46353EEBE6EBB862578500012B04D</link>
	</item>
	<item>
		<pubDate>Fri, 11 Mar 2011 05:49:56 +0000</pubDate>
		<title>re: Automatic location switching - based on IP</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; Marcel Damseaux&lt;br /&gt;&lt;b&gt;Comment:&lt;/b&gt; Believe me you do need locations in our situation, we have 40.000 users and Office and Internet locations since 1996 and lots of Notes admins and consultants are and have been in our environment and nobody got a better idea.&lt;br /&gt;There is also a performance issue, you do not want Notes to try connections to servers it will not be able to reach, that will slow down the startup of the client (for the #%#$% ECL refresh - which could be done on the background later, that should be another good idea actually). If the client already knows by its IPs whether to use passthru or direct IP/DNS it would be connecting right away at startup thus starting the client faster.&lt;br /&gt;</description>
		<link>http://ideajam.net/ideajam/p/ij.nsf/0/A7CFD0B5D3C1A4998625784E007469D2?opendocument&amp;#commentsanc&amp;id=5EAE359B5F3B2B6A8625785000200998</link>
	</item>
</channel></rss>
