RDP to the server, and then start another RDP from the server, not getting original client name

rdp

We have wyse winterm stations login into a terminal server via a RDP session, from that server they rdp into a separate terminal server 2008. My question is, how can I get the original client station name on the second terminal server. I currently just see the name of the 1st terminal server as the client name. We use the client name to set the default printers for each station. Any help would be appreciated. thanks

Best Answer

I'm afraid that the original client name gets lost on the second RDP session. I went through all parameters and there isn't any that you can switch on to solve that.

However, I have this idea of a work around. When you initiate the second RDP session, you could run specify a program to run, say: c:\initiate.bat. In your RDP connection setting you would then put something like c:\initiate.bat %clientname%.

In the second server, you create the c:\initiate.bat file and in it, you can set a variable using the parameter.

If you can use a different variable than CLIENTNAME then I would do:

set MYVARIABLE=%1

If you absolutely have to use the CLIENTNAME variable, then you can try overwriting the variable with the regular SET command and then in the batch file start the program you want to use.

But you are talking about setting a default printer so presumably, this is done by a script running, not starting a program, so you could do this with the idea given above. Instead of running the script as a "log on script" on the server, you start the script from the RDP connection options and you pass the %CLIENTNAME% variable from the first server.

I did not test all this, but that's an idea that can give you either a solution exactly or an idea to further work from.

Related Topic