I needed to create a citrix published application that would login using a RDP connection to another server with a saved username and password. Well I thought all you needed to do was create a RDP file, save the username and password and then run mstsc.exe with the RDP file. Yeah that only works for the person who created the file, but won’t work with all users, because the password is encrypted in hash against the logged users SID. Bascially in laman terms you are screwed, it will work for you, but you can’t just make that file public and make it work for anyone. After searching high and low for a solution I finally found one. Now I’m using this to publish a citrix application but this will work for anything. This guy, Remko Weijen created a command line RDP tool called LaunchRDP.exe. This will launch RDP, with a username and password. Note this isn’t encrypted. The link to the file is here, or you can find it in the downloads section of the website. Here’s the command line.
LanchRDP.exe SERVERNAME PORTNUMBER(TYPICALLY 3389) USERNAME DOMAIN PASSWORDÂ CONSOLE(0-false, 1-true) REDIRECTDRIVES(0-false, 1-true) REDIRECTPRINTERS(0-false, 1-true).
So if I wanted to launch RDP to 10.10.1.1 with a username demouser, and a password of demopass, but no domain heres the command I would use. No console, not redirecting drives or printers.
LaunchRDP.exe 10.10.1.1 3389 demouser demopass 10.10.1.1 0 0 0
Simple as that!
Leave a Reply