We run an access application which we compile to a 2007 runtime file for an application on our production floor. The application pulls the username from the environment variable and uses that username to pull the parameters of the station from a SQL Database.
We run the application on a NLB group of 2008 R2 Remote Desktop Servers. So, a thin client on the floor connects, logs in as the username of that specific station, the environment variable for username and computername are read, and the station proceeds to load its particulars.
Well, we have a problem periodically where one of the 4 servers, when stations load, they cant get the username, and as such the program cannot load completely. We end up moving stations off that server, rebooting the server and then moving them back on. Any stations currently active though work fine, it is only on a fresh login that the stations have issues.
Further, if we move the session from Server A to Server B for example, it works. Move it back to A and it doesn't work until a Reboot occurs.
So, my question is: we use the following two calls for collecting %username% and %Computername%
Is there a better solution for pulling reliably the username of the logged in user, and the server name that the station is connected to?
Keeping in mind, this is a remote desktop server environment. It needs to pull the logged in username of that session, not of the console or anything like that.
Any suggestions would be greatly appreciated.