1

So here's an interesting project:

We have a legacy system that runs in many locations via Citrix (brick and mortar stores)

We use a large farm for Citrix, so when you log in, you never know which server you will connect with.

We want to be able to programmatically determine which store the user is in.

I was thinking that if Citrix provides a way to use location services, then we might be able to use that. The trick would be that I need the location of the physical client machine, not the random Citrix session that is hosting the application.

Is there a way to do that? Is there any other way to help correlate the location?

JMarsch
  • 21,484
  • 15
  • 77
  • 125
  • Perhaps you should modify the login process with a drop-down to select what store the user (clerk?) is in. – Andrew - OpenGeoCode Jan 14 '14 at 22:22
  • @Andrew-OpenGeoCode that's actually what it does now, but it causes real problems. Clerks often float between stores. They constantly choose the wrong store (usually their "home" store, and not the one they are visiting), and it wreaks havoc downstream from them at end of month. We are looking for a way to resolve the store automatically. – JMarsch Jan 14 '14 at 22:25
  • what programming language/environment is the application written in? – Andrew - OpenGeoCode Jan 14 '14 at 22:30
  • I'm not familiar with Citrix, but from googling sounds like they run on top of Windows. If you're writing in .Net, Citrix appears to provide a Geolocation assembly: http://www.citrix.com/mobilitysdk/docs/cmp.net/html/d4eb7a6d-640c-d14d-6a39-7be6741df675.htm – Andrew - OpenGeoCode Jan 14 '14 at 22:33
  • Hi Andrew: sorry, I missed your comments. It's in c#/.net 4.0, but I can p/invoke if necessary. – JMarsch Jan 17 '14 at 00:31

1 Answers1

2

It is possible in specific use cases to get the location of the client device. The Mobile SDK for Windows Apps supports determining location. However, it requires a mobile device and the server platform must be either XenApp 6.5 or XenDesktop 7.0 or above. The interface is the same as the Windows 7 location API but it works with the remote mobile device to determine location. Here is a video of how to use the API: http://www.citrix.com/tv/#videos/5377

Based on your configuration, you will most likely have desktop computers. If this is true, you might need to investigate other solutions. The most obvious path is to use the client IP address. If each store has different client IP address ranges, it would be fairly easy map between the IP address and the store. It is possible to get the client IP address: http://blogs.citrix.com/2008/03/07/how-to-get-the-client-ip-address-or-hostname-of-a-citrix-session-or-terminal-services-session/

Jeff Muir
  • 95
  • 1
  • 10
  • An example of a program using the SDK for Location can be found at http://www.ctrl-alt-del.com.au/CAD_XALocLaunch.htm – Jeff Muir Jan 15 '14 at 06:11
  • Hi Jeff - your link looks very promising. There is a potential issue -- if I only get the IP of the client machine, it's likely to be a 192.168.1.x address that is behind a NAT -- I'll likely really need the IP of the store gateway. Is there a way to communicate with an exe that is running on the client machine (I could drop a really simple service on the client machines that gets the info and makes it available to the citrix session, if there is a way to do so). – JMarsch Jan 15 '14 at 15:25
  • It is possible to get the "real" address allocated to the client machine. Please review this [question](http://stackoverflow.com/questions/2461325/detect-source-of-remote-desktop-connection). The answer that is most relevant is about WinStationGetRemoteIPAddress. If you were to try to access a client exe, that would not work. It has to be something in the RDP/HDX protocol given to the server. I did some experimenting yesterday and found the client IP address. For good or bad, it was a VPN IP address. Also, keep in mind that you could change DHCP on gateways to give unique IP addresses. – Jeff Muir Jan 17 '14 at 00:22
  • Thanks, Jeff. I will take a look. Sounds like we should be able to pull this off with a combination of unique ip range per store and using that API. – JMarsch Jan 17 '14 at 00:32