Display Microsoft Terminal Services ActiveX Control (or Microsoft RDP Client Control

来源:互联网 发布:手机不让安装软件 编辑:程序博客网 时间:2024/06/11 05:51

利用activeX控件在网页里自动登录WIN2003远程桌面并实时控制


发布时间:2009-5-18 11:04:00 | 932人感兴趣 | 人参与 | 评分:3


首先要自己配置并打开受控端的WEB远程桌面服务,这个在“添加/删除windows组件”里有,我只在windows 2003 server里试过,没试过XP。下面我们在客户端安装微软提供的远程桌面客户端控件,这个控件的安装包可以在windows2003服务器的system32目录下找到,你可以放到web虚拟目录下供客户端下载。
  远程桌面客户端控件安装完成后,在客户端计算机打开frontpage2003,创建一个新页面,选“插入”->插入WEB组件->自定义...->找到MicroSoft Rdp Client Control(redist),(我的文件位置在D:\WINDOWS\Downloaded Program Files\msrdp.ocx)然后确定,在“插入WEB组件”界面中选中MicroSoft Rdp Client Control(redist),再确定。
在frontPage的代码窗口里会自动生成如下代码:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body>

<object classid="clsid:9059F30F-4EB1-4BD2-9FDC-36F43A218F4A" id="MsRdpClient21" CODEBASE="/tsweb/msrdp.cab" WIDTH="350" HEIGHT="200"
>
<param name="Server" value="127.0.0.1">
<param name="FullScreen" value="0">
<param name="StartConnected" value="1">
</object>

</body>

</html>

  我们把上面的MsRdpClient21改名为MsTsc,把带param 的三行删除,因为我们要用脚本实现自动登录。另外CODEBASE="/tsweb/msrdp.cab"这个你自己填正确的地址,比如我的服务器giftRen.com/tsweb/msrdp.cab(只是假设,我并不提供这个下载)。在windows2003系统目录下有这个安装包。

然后我们在head段内添加如下代码(注意这里的赋值要根据你服务器的配置自己改):

<script language="VBScript">

Sub window_onLoad()
Document.all.MsTsc.Server = "myName"
Document.all.MsTsc.UserName = "administrator"
Document.all.MsTsc.AdvancedSettings.ClearTextPassword = "mypassword"
Document.all.MsTsc.Domain = "myDomain"

Document.all.MsTsc.Connect()
End Sub
</script>
最终代码是这个样子的:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<script language="VBScript">

Sub window_onLoad()
Document.all.MsTsc.Server = "127.0.0.1" '远程服务器地址
Document.all.MsTsc.UserName = "administrator" '登录账号
Document.all.MsTsc.AdvancedSettings.ClearTextPassword = "SinaBlogShanHaiJing" '登录密码
Document.all.MsTsc.Domain = "GongAnMis" '要登录的域

Document.all.MsTsc.Connect()
End Sub
</script>

 

</head>
<body>

<object classid="clsid:9059F30F-4EB1-4BD2-9FDC-36F43A218F4A" id="MsTsc" CODEBASE="www.giftRen.com/tsweb/msrdp.cab" WIDTH="600" HEIGHT="500">

</object>


</body>

</html>

  最后保存网页,用IE打开,看看我们的惊奇成果!另外还可以在一个网页上嵌套多个不同主机的远程桌面界面。欢迎访问我的blog
  利用这个手段,你可以做一套基于B/S(浏览器/服务器)模式的网管系统,把公司员工的计算机都创建一个管理账号,把他们所有IP地址和密码、账号保存到数据库中,然后通过统一的WEB界面来管理,我想对网管员比较管用,不过可不要用于黑客的目的啊。


Display Microsoft Terminal Services ActiveX Control (or Microsoft RDP Client Control)

Updated: March 27, 2009

Applies To: Windows SBS 2008

To display the Microsoft Terminal Services Client ActiveX Control (or the Microsoft RDP Client Control) in the Manage Add-ons dialog box
  1. Click Start, in the Search box type regedit, and then press ENTER.

    CautionCautionIncorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.

  2. On the User Account Control page, click Continue.

  3. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Ext\Settings\, right-click {7584C670-2274-4EFB-B00B-D6AABA6D3850}, and then click Delete.

  4. Close and restart Internet Explorer, and then try to connect to the computer by using Remote Web Workplace again. If you still get a message that says, “The Microsoft Terminal Services Client ActiveX Control (also known as Microsoft RDP Client Control) is unavailable,” proceed to step 5 to re-register the mstscax.dll file.

  5. Click Start, click Run, in the Open box type %windir%\system32\regsvr32 mstscax.dll (see Figure 16), and then click OK.

    e18db2af-3fca-4d16-b45e-b1bb7cf117f0
  6. To confirm, click OK.

  7. Restart Internet Explorer, and then connect to your desktop from the remote computer by using Remote Web Workplace.



0 0
原创粉丝点击