Essentially I'm looking for some way via batch (or potentially powershell, but win XP machines so ideally batch) to open up a RDP connection to a LAN based Terminal Server upon a user logging into a machine. Ideally it would involve some (maybe partial) SSO process i.e. taking the users currently logged in credentials and passing this to an mstsc call to log them into a terminal server, no explorer.exe would load on login, just the connection straight to the terminal server.

Also, whether this is possible, after disconnecting from the TS, the Windows session automatically logs off?

Has anyone achieved something similar like this, any suggestions are appreciated!

  • This may be close to what you need: create a .rdp file for each user that connects them to the server with their credentials. Save this RDP file to their Start Menu startup folder. When they log in to their workstation they'll then automatically launch the .rdp file and login to the server. – joeqwerty Aug 22 '13 at 21:58
  • Ideally I would like something that can dynamically create those .rdp files feeding username via env variable %username% etc. – PnP Aug 22 '13 at 22:01
  • Well, scripts can be used to automatically generate files... – gWaldo Aug 22 '13 at 22:32

Something like this but it's kind of a hack (editing HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell).

Basically set their shell to mstsc.exe and specify the RDP file to use with a script per user. They'd still have to log in twice though (although you could set the XP machine to autologin at boot with a local ID and start the RDP session automatically so the user would only know they were booting once).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.