: 4582 | 108638 | 12353

Automatic location switching - based on IP 
New idea submissions, commenting and voting are no longer available on this site. Logins have also been disabled.
Use this IdeaSpace to post ideas about the Notes Client.

: 36
: 36
: 0
: location document, location, passthru
: Marcel Damseaux211 09 Mar 2011
:
: / Email
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.
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.
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.
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.
This would be very similar to Sametime "Geographic locations", it doesn't seem to be "rocket science"; 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!).
 
- Stores location-ranges associations in notes.ini variable, like
$IPLocation=193.180.188.*,Internet;,Internet;192.168.1.*,Internet;10.2.42.*,Office (Network)
 
Sub LocationSwitcher
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
iplocationarray=Split(session.GetEnvironmentString("IPLocation", False),";")
' Search the location to switch to
locationfound=""
myip=currentRange()
Forall iploc In iplocationarray
If Strleft(iploc,",") = myip Then
locationfound = Strright(iploc,",")
End If
End Forall
If locationfound<>"" Then
Print "Setting location according to range "+myip+": "+locationfound
On Error Resume Next
Call workspace.SetCurrentLocation(locationfound)
On Error Goto 0
' pending - validate the location - if it doesn't exist present list  Call workspace.SetCurrentLocation("Internet") is valid!
Else
Call workspace.SetCurrentLocation("")
' Store the location chosen for the future
location=Strleft(session.GetEnvironmentString("Location", True),",")
If iplocationarray(0)="" Then
Call session.SetEnvironmentVar("IPLocation", myIP+","+location,False)
Else
Call session.SetEnvironmentVar("IPLocation", myIP+","+location+";"+session.GetEnvironmentString("IPLocation", False),False) ' notice the new one is added at the begining so if exceeded string older are discarded
End If
End If
End Sub
 
Function CurrentRange() As String
' This way also gets VPN address
allranges=""
Set IPConfigSet = GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery ("select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
Print "Getting IPs", Now
Forall IPConfig In IPConfigSet
If Not Isnull(IPConfig.IPAddress) Then 
For i=Lbound(IPConfig.IPAddress) To Ubound(IPConfig.IPAddress)
If IPConfig.IPAddress(i) <>"0.0.0.0" Then
CurrentRange=Strleftback(IPConfig.IPAddress(i),".")+".*" ' return only one
Exit Function
End If
Next
End If
End Forall
CurrentRange=Fulltrim(allranges)
End Function



1) David Hablewitz15237 (11 Mar 2011)
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.)
2) Marcel Damseaux211 (11 Mar 2011)
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.
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.










:
:




Welcome to IdeaJam™


You can run IdeaJam™ in your company. It's easy to install, setup and customize. Your employees, partners and customers will immediately see results.

Use IdeaJam to:

  • Collect ideas from employees
  • Solicit feedback and suggestions from employees and customers
  • Run innovation contests and competitions
  • Validate concepts
  • Use the power of "crowd-sourcing" to rank ideas and allow the best ideas to rise to the top

IdeaJam™ works with:

  • IBM Connections
  • IBM Lotus Quickr
  • Blogs and Wikis
  • Websphere Portal
  • Microsoft Sharepoint
  • and other applications.

IdeaJam has an extensive set of widgets and API's that allow you to extend and integrate IdeaJam™ with other applications.

Learn more about IdeaJam >>


0
Use more customization features in ND9 NotesMail
13
Two-week Calendar view
3
@Formula library
25
Drafts - unsent count?
2
New Hide-When property
3
Activity Logging for Quickr
5
"follow-up complete" flag
15
Remake Resource Reservation template using XPage
6
Boolean operators on LDAP group based access control
17
Store IP Address / remote host data in Password Lockout documents
18
Checking Out-Of-Office status of others
7
DocumentCollection.search(@formula)
23
Tool to show unreferenced design elements for easy cleaup
5
Bring sametime audio and video into the web browser using WebRTC
17
"Window Title" for views
17
QuickR application/widgets for Android/iPhone
21
Create Computed Text with the same text style as the current paragraph
9
@Function and LotusScript to "View..Customize This View" dialog
8
Extend the 'User detail' info of a database
17
Print of calendar in color
6
Shared Actions belong under Shared Elements
20
Facelift all web enabled templates with xPages
3
Please extend WebDAV to include calDAV & cardDAV support for contacts/calendar syncing
2
Skin-ing Notes Design elemens
14
Add some views into the "Views" section of the Notes 8.5 mailbox






IdeaJam developed by

Elguji Software Logo