Web Based RDP Client

2019-09-18 07:16发布

问题:

Can I permit RDP based connections from a website using PHP/JS/etc? I've read that RDP session files can be placed on the web server but would prefer to implement it via code. I am looking for the best way to offer a centralized management of windows machines and allow direct RDP connections.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa383019%28v=vs.85%29.aspx

This looks like it could potentially work, although it requires IIS as the web-server and requires a role to be installed on all remote machines. If possible, I would like to find a solution permitting this to work under a Nix based web-server and without any need for modifications on the remote servers.

回答1:

This problem was resolved by creating an .rdp session file with PHP. Not to cleanest approach as a embedded solution would be better, but is the most viable I have found.

<?

$file = 'screen mode id:i:2
desktopwidth:i:1436
desktopheight:i:925
session bpp:i:16
auto connect:i:1
full address:s:<SERVERIP>:<SERVERPORT>
compression:i:1
keyboardhook:i:2
audiomode:i:2
redirectdrives:i:0
redirectprinters:i:0
redirectcomports:i:0
redirectsmartcards:i:0
displayconnectionbar:i:1
alternate shell:s:
shell working directory:s:
disable wallpaper:i:1
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:1
bitmapcachepersistenable:i:1
winposstr:s:0,3,0,0,800,600
redirectclipboard:i:1
redirectposdevices:i:0
drivestoredirect:s:
autoreconnection enabled:i:1
authentication level:i:0
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
allow desktop composition:i:0
allow font smoothing:i:0
disable cursor setting:i:0
gatewayhostname:s:
gatewayusagemethod:i:0
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0';

header("Content-Disposition: attachment; filename=filename.rdp");
header("Content-Type: application/rdp");
print $file;
exit();

?>