4

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

1 Answers1

1

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.

ETL
  • 6,513
  • 1
  • 28
  • 48
  • I think the variable idea might work for me. THe reason they connect to an rdp then a second rdp is the first one gets them into the NICU terminal server with hosp apps, the second one is an otside vendor with their own application on a separate server and the Dr.'s need access to both. – Jessie Prado Feb 13 '15 at 16:59
  • Just wanted to add that this works, but the batch file should contain the line: set MYVARIABLE=%1. Using the setx command did not produce the variable in my tests. – McKenning Nov 21 '16 at 16:10