Determine Whether a User is on Citrix or Not (1 Viewer)

Isaac

Lifelong Learner
Local time
Today, 12:05
Joined
Mar 14, 2017
Messages
8,777
I'm looking for code that would help me determine Yes/No if a user is currently on Citrix using my Access app. I am going to have a mixed population of users - maybe up to 1/3 on Citrix, the rest are not. Due to the fact that some of our Sharepoint sites do not play well with Citrix users, I need to be able to react to that intelligently in my database - and I'd rather just know that they are on Citrix, rather than trying to determine whether their Sharepoint connection is playing well, since that problem usually just presents itself as numerous, repeating, Sharepoint credential pop-ups rather than any trappable error.

My first instinct was to test various VBA methods of getting: the Desktop path, the Documents path, and the AppData path. I'd send a small tool to 3 people--2 of whom are not on Citrix, one of whom is. Almost surely, I will end up seeing that the Citrix user's value (for at least 1, if not all 3, of those locations) is unique to them as a Citrix user. I'm planning to send this test tool to the 3 of them later today and see what it yields. I would probably use at least 2 methods to get each of these 3 locations (if not more) - Environ, VBScript SpecialFolders and VBScript ExpandEnvironmentalVariables (I may have misspelled that last one).

Does anyone know of additional ways of testing?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 14:05
Joined
Feb 28, 2001
Messages
27,175
@Isaac - the problem is that we have had MANY questions about knowing whether someone was coming in through local or WiFi connections and the problem was that Windows hides that from you. Well, the connection for Citrix is in the same boat.

My suggestion is to cheat. (OK, actually my suggestion is that when you have an insoluble problem, see if you can change the problem to one you CAN solve.)

Every user of an Access app should have a private copy of the FE. So... if you have a sympathetic (rather than simply a pathetic) IT department, see if you can make all of the users have private folders that are sub-directories of C:/CITRIXUSERS/ and then you have your indicator. (Yeah, you guessed it... at wine tastings I read labels too.) And of course if they prefer a shorter name for that folder - as long as it isn't just /USERS/ - then you would still have your answer.
 

isladogs

MVP / VIP
Local time
Today, 20:05
Joined
Jan 14, 2017
Messages
18,217
If you can detect the workstation used to login using Citrix against a list of local workstations, then you should be able to solve your issue.
However, having never used Citrix, I'm not sure if that's a feasible solution
 

Isaac

Lifelong Learner
Local time
Today, 12:05
Joined
Mar 14, 2017
Messages
8,777
@The_Doc_Man Ok, but wait...are you saying that a folder called c:\citrixusers exists for all citrix users? If so the existence of that folder could be my check.

At the moment, "we" are trying to avoid having to wade through the bureacracy to ask the Citrix administrators that question.......Because if we did, and I agree, it would be nice to have everyone have their own private folder as you describe...(currently I was just going to have them put it on their desktop)......But then, the act of making those folders would require us to know which one of our users ARE Citrix users.....And if I had that list, I wouldn't have this need, basically. If that makes sense.

I'm hoping to test for the existence of some kind of environment or directory that will look/feel different for a citrix user
 

Isaac

Lifelong Learner
Local time
Today, 12:05
Joined
Mar 14, 2017
Messages
8,777
If you can detect the workstation used to login using Citrix against a list of local workstations, then you should be able to solve your issue.
However, having never used Citrix, I'm not sure if that's a feasible solution
I do have the opportunity to send "tests" (to be performed for me), to 2 people who I know are Citrix users, and 2 who I know are not, including myself too. I was thinking of testing the location of their %appdata% environment value, %userprofile%, and my documents, which I suspect will look different on Citrix.

Is that kind of what you meant? Give a test (of some kind, maybe the one described above) to a known Citrix user to run on their workstation while logged in?
 

Isaac

Lifelong Learner
Local time
Today, 12:05
Joined
Mar 14, 2017
Messages
8,777
I just dug into my dusty archives on Adrive.com, some code snippets from FE db's created years ago when I dealt with some Citrix users. I found this line of code that I used to determine it:

Code:
If InStr(1, LCase(Environ("temp")), "appdata\local") > 0 Then 'then they are logged on to [redacted] desktop

Quite possibly that precise logic will not work in my case now (for example, my own %temp% path, actually does contain appdata\local, and I'm not on Citrix).........But it jolted my memory. Testing the %temp% path is one more thing I'm going to send out in my test to be performed by these 5 cooperative individuals, 2 on Citrix, 3 who are not. I have a good feeling about that coming back substantially different for the C users. We'll see!
 

isladogs

MVP / VIP
Local time
Today, 20:05
Joined
Jan 14, 2017
Messages
18,217
You can easily test the workstation on which the login took place using WScript or Environ. The question is whether the Citrix user's workstation will be reported as their host PC or the one that is being remoted into
 

Isaac

Lifelong Learner
Local time
Today, 12:05
Joined
Mar 14, 2017
Messages
8,777
You can easily test the workstation on which the login took place using WScript or Environ. The question is whether the Citrix user's workstation will be reported as their host PC or the one that is being remoted into
Ok ... I get what you are saying now. Yes...that makes perfect sense. I'm hopeful, since in past scenarios I did notice some differences in the way VBScript and VBA reported environments like that.

So what would you suggest the actual test be, then? That's the remaining question?
 

isladogs

MVP / VIP
Local time
Today, 20:05
Joined
Jan 14, 2017
Messages
18,217
Store a list of local workstations which can log into your app as a local or linked table within your app
Check the logged in workstation using e.g. CreateObject("WScript.Network").ComputerName when someone logs in remotely using Citrix.
Does that report their remote workstation or the host PC?
 

Isaac

Lifelong Learner
Local time
Today, 12:05
Joined
Mar 14, 2017
Messages
8,777
Store a list of local workstations which can log into your app as a local or linked table within your app
Check the logged in workstation using e.g. CreateObject("WScript.Network").ComputerName when someone logs in remotely using Citrix.
Does that report their remote workstation or the host PC?
I have included a test for ComputerName in the workbook that I sent each asking them to run my button, so that will be one of the things that comes back....I'll make sure I know whether the reported PC name is their local or remote.....and then post back here how it went.

Thanks
 

Users who are viewing this thread

Top Bottom