carswelldp
asked on
1 User Logging into Multiple PC terminal service session: %clientname% environment variable doesn't update: why?
OS: Windows 2003 Server SP2 (with terminal services enabled).
We are keying off the %clientname% environment variable for our application to work under terminal services.
The problem is this:
A user logs into a terminal service session from PC a. Then the user doesn't log out of the terminal server session but creates another terminal service session from PC b. So now the user is logged into the same terminal server 2x but with different session id's. The problem is that the %clientname% variable doesn't update when the user logs in from PC b. The %clientname% is still reflecting that of PC a.
Is there a way to force this variable to update when the user logs into PC b? Better yet is there a better variable that is unique and static to each PC?
We are keying off the %clientname% environment variable for our application to work under terminal services.
The problem is this:
A user logs into a terminal service session from PC a. Then the user doesn't log out of the terminal server session but creates another terminal service session from PC b. So now the user is logged into the same terminal server 2x but with different session id's. The problem is that the %clientname% variable doesn't update when the user logs in from PC b. The %clientname% is still reflecting that of PC a.
Is there a way to force this variable to update when the user logs into PC b? Better yet is there a better variable that is unique and static to each PC?
ASKER
Yes unique but not static. The session id can change.
Our program has been coded to look into a folder c:\tsclient\%CLIENTNAME%\. .. for its configuration settings. Each client machine has specific settings relating to it. So the configuration cannot change and must remain static.
Our program has been coded to look into a folder c:\tsclient\%CLIENTNAME%\.
Why you do not restrict the user to one single session? Launch TSCC.MSC and you will see the setting right there.
Claudio Rodrigues
Microsoft MVP
Windows Server - Terminal Services
Claudio Rodrigues
Microsoft MVP
Windows Server - Terminal Services
ASKER
I would like to do that very much. However, the needs of our client dictate otherwise. In this circumstance the user (according to the client) has to be logged into 2 sessions with the same userid. I am trying to find a way around this by selecting a unique environment variable to the client terminal server session. CLIENTNAME appeared to work wonderfully till this issue with the CLIENTNAME not being updated upon login to a different user session while connected to the other. I realize this may be a limitation of terminal services and in our extensive research this seems to be the case.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Claudio Rodrigues
Microsoft MVP
Windows Server - Terminal Services