Discussion:
Automatically logon using ActiveX Web Remote Desktop?
(too old to reply)
Matt C.
2005-05-12 18:52:15 UTC
Permalink
I am new to working with TS, and have never tried to script it. I'm
wondering if the following setup is workable:

We're talking about doing Remote Desktop using the ActiveX browser control.
What we'd like to do is have different links on our (secured) webpage which
would make different Remote Desktop connections (based on which link was
clicked). Also, we would like to start the Remote Desktop connection as
soon as the link is clicked, with automatic login, i.e., the TS session
starts immediately upon clicking the link.

Passing through the authentication to TS is the obvious tricky part. The
user name and password for the Terminal Server connections will be the same
as the ones we are using for our secure website. It seems like we SHOULD be
able to make this work. We are using Basic Authentication over SSL, so we
should be able to get the cleartext password from the server variable
AUTH_PASSWORD. We should then be able to apply the username and this clear
text password to the RDP control (there appears to be a ClearTextPassword
property in AdvancedSettings for the ActiveX control). Voila, we're there.

However, I haven't been able to find any references to other people doing
this, and it seems like something other people would have tried. So I'm
wondering if there is some sort of hitch here that I am missing.

Does the above sound like a workable plan?

Matt
SFrost
2005-07-12 19:35:03 UTC
Permalink
Hi there Matt:

I was able to get something like this working. Here is my ASP script; feel
free to tweak it by replacing the IP number, domain, username and password
with your own information. Simply point your browser to this ASP file and
you should automatically be logged in to the remote desktop session. A few
things to note:
- it only works with Microsoft's browser - Internet Explorer
- the server must be configured to accept log-ins from the client... there
is a control on the server like, "Always prompt for password" and this has to
be OFF
- I also think that the server (i.e. the IP number you type in) has to be in
your client's "Trusted Sites". You can add this in internet explorer under
Tools -> Internet Options -> Security -> Trusted Sites

Unfortunately, this solution makes the password clearly visible if you go
"View--> Source" once you have started your Remote Desktop connection. I
have been looking at ways to improve this, but haven't been successful so
far. Anyway, here is my script so far:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<title>Remote Desktop Connection</title>
</head>
<OBJECT ID="Tsc"
CLASSID="CLSID:9059f30f-4eb1-4bd2-9fdc-36f43a218f4a"
CODEBASE="../msrdp.cab#version=5,1,2600,1095"
WIDTH="780"
HEIGHT="576" >
</object>
<BODY>
<script language="Vbscript">
sub window_Onload
Tsc.server = "127.0.0.1"
Tsc.domain = "MY_COMPUTER_NAME"
Tsc.username = "johnsmith"
Tsc.AdvancedSettings.ClearTextPassword = "mysecret"
Tsc.Desktopwidth = "780"
Tsc.Desktopheight = "576"
Tsc.Advancedsettings2.Redirectdrives=FALSE
Tsc.Advancedsettings2.Redirectports=FALSE
Tsc.Advancedsettings2.Redirectprinters=TRUE
Tsc.Advancedsettings2.Redirectsmartcards=FALSE
if Tsc.SecuredSettingsEnabled then
Tsc.Securedsettings.StartProgram="C:\WINDOWS\notepad.exe"
else
msgbox "Cannot access secured setting (startprogram) in the current
browser zone"
end if
Tsc.Securedsettings.Workdir="C:\WINDOWS"
Tsc.Connect
End sub
</script>
</body>
</html>

Good luck and I hope this helps.
Post by Matt C.
I am new to working with TS, and have never tried to script it. I'm
We're talking about doing Remote Desktop using the ActiveX browser control.
What we'd like to do is have different links on our (secured) webpage which
would make different Remote Desktop connections (based on which link was
clicked). Also, we would like to start the Remote Desktop connection as
soon as the link is clicked, with automatic login, i.e., the TS session
starts immediately upon clicking the link.
Passing through the authentication to TS is the obvious tricky part. The
user name and password for the Terminal Server connections will be the same
as the ones we are using for our secure website. It seems like we SHOULD be
able to make this work. We are using Basic Authentication over SSL, so we
should be able to get the cleartext password from the server variable
AUTH_PASSWORD. We should then be able to apply the username and this clear
text password to the RDP control (there appears to be a ClearTextPassword
property in AdvancedSettings for the ActiveX control). Voila, we're there.
However, I haven't been able to find any references to other people doing
this, and it seems like something other people would have tried. So I'm
wondering if there is some sort of hitch here that I am missing.
Does the above sound like a workable plan?
Matt
Loading...