重新sorting远程桌面连接

我安装了adminpak.msi,以便可以使用远程桌面MMC连接到所有服务器。 当我添加一个服务器时,它会到达可用服务器列表的底部。 我找不到如何重新sorting他们成为更多的逻辑分组,或至less按字母顺序。 有任何想法吗?

皇家TS可以帮助您pipe理/组织您的远程桌面连接。 terminal也可以做类似的事情。 另一种方法是为每个连接创build远程桌面快捷方式,并将它们存储在可按名称sorting的文件夹中。

我会强烈推荐一个免费的应用程序,我已经使用了过去几周(我没有其他方式的附属),称为RD Tabs (由Avian Waves ) 。 该工具非常灵活,允许您创build多个窗格,每个窗格包含多个选项卡,快速缩略图预览访问,几乎每个function的键盘快捷键(非常适合不喜欢强迫使用鼠标的人),以及甚至是该工具的命令行/脚本自动化。 sorting和分组仅涉及拖放操作,您可以轻松导入现有的远程桌面configuration文件。

我find了解决scheme。 看起来像msc文件有一个encryption区域,只是无法访问。 所以我在http://twistingthewick.orgfind了Brett Clarke的剧本。 我修改了一下来添加结构和login信息。 它使用我们的老朋友SendKeys。

您需要创build一个CSV:

服务器名称或IP,描述,用户ID,域名

每个服务器每行一个。 你必须按照你想要的方式来sorting。

您还可以使用以下语法添加一行来将其分成独立的广告插件:

—一些名,,

某些名字不被使用; 每个部分都被命名为远程桌面。 如果有人能弄清楚如何改变名字,请告诉我。

现在,这似乎工作,并允许重新build设任何时候你需要添加一个服务器。 您可能需要调整系统上的延迟。

哦,这可能不适用于Vista或Windows 7,因为SendKeys方法已被禁用出于安全目的。

我喜欢共享驱动器,所以这个脚本检查那个盒子。 你可以修改它来做你需要的任何事情。

首先,你需要从一个空白的tsmmc.msc文件开始。 打开MMC并添加一个远程桌面pipe理单元。 该脚本需要在c:\ Projects \ SortMmc中将其命名为blanktsmmc.msc。 当然,你需要加载Windows Admin Pak。

脚本是功利的,为编码速度而devise,而不是优雅。 如果您进行了改进,请分享。

而且我是新来的。 如果你喜欢这个,我可以用一些噶!

' CreateTSMMC.vbs ' Script to re-create tsmmc entries in order ' Author: Brett Clarke http://twistingthewick.org ' Version: 0.1 – 21/06/2007 ' ' Updated by Brian Travis, adding login and drive info ' Version: 0.2 - 2009-08-26 '——————————————————————— 'Declare some variables Option Explicit Const ForReading = 1 Dim objShell, objFSO, objFileCopy, objDictionary, objTextFile Dim strBlankMMC, strWorkingMMC, strTemplate, strNextLine Dim arrRDPList Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") Set objDictionary = CreateObject("Scripting.Dictionary") strBlankMMC = "c:\Projects\SortTsmmc\blanktsmmc.msc" strWorkingMMC = "c:\windows\system32\tsmmc.msc" strTemplate = "c:\Projects\SortTsmmc\tsmmc.csv" Set objFileCopy = objFSO.GetFile(strBlankMMC) Set objTextFile = objFSO.OpenTextFile (strTemplate, ForReading) ' copy the blank template file over the working file objFileCopy.Copy (strWorkingMMC) ' start up MMC objShell.Run "c:\windows\system32\tsmmc.msc" ' wait for the app to start Wscript.Sleep 1500 ' get to the plugin objShell.SendKeys "{DOWN}" ' read the CSV file, and parse the entries into the MMC session Do Until objTextFile.AtEndOfStream strNextLine = objTextFile.ReadLine arrRDPList = Split(strNextLine , ",") if arrRDPList(0) = "---" then ' create a new group objShell.SendKeys "%f" objShell.SendKeys "m" objShell.SendKeys "%d" objShell.SendKeys "rem" objShell.SendKeys "%a" objShell.SendKeys "%c" objShell.SendKeys "{ENTER}" objShell.SendKeys "{END}" else objShell.SendKeys "+{F10}" objShell.SendKeys "A" objShell.SendKeys arrRDPList(0) objShell.SendKeys "{TAB}" Wscript.Sleep 100 objShell.SendKeys "{TAB}" Wscript.Sleep 100 objShell.SendKeys arrRDPList(1) Wscript.Sleep 100 objShell.SendKeys "{TAB}" Wscript.Sleep 100 objShell.SendKeys "{TAB}" objShell.SendKeys arrRDPList(2) Wscript.Sleep 100 objShell.SendKeys "{TAB}" objShell.SendKeys "{TAB}" objShell.SendKeys arrRDPList(3) objShell.SendKeys "{TAB}" objShell.SendKeys " " objShell.SendKeys "{ENTER}" Wscript.Sleep 100 ' turn on drive sharing Wscript.Sleep 100 objShell.SendKeys "{TAB}" objShell.SendKeys "{END}" objShell.SendKeys "+{F10}" objShell.SendKeys "r" objShell.SendKeys "+{TAB}" objShell.SendKeys "{RIGHT}" objShell.SendKeys "{RIGHT}" objShell.SendKeys "{TAB}" objShell.SendKeys "{TAB}" objShell.SendKeys " " objShell.SendKeys "{ENTER}" ' get back to left column objShell.SendKeys "+{TAB}" end if Loop objShell.SendKeys "^s" WScript.Quit 

不知道我的远程桌面(v5.2.3790.0)版本中的button/字段/选项(或者是什么)改变了,但是如果有人在v0.1或v0.2build立RD时遇到困难,这里有一个v0 .3与我的微小的变化,终于得到它在我的XP机器上正确自动化。 希望这可以帮助。

PREREQS(有关如何创build这些文件的详细信息,请参阅v0.1,v0.2文章):

  • 当前目录中名为blanktsmmc.msc的空白tsmmc.msc文件。

  • 当前目录中的tsmmc.csv文件格式适当。

CSV文件示例分成几个部分:

  ---[AGENTS]---,,, agent-pc,,neo,thematrix agentsmith-pc,,neo,thematrix ---,,, ---[THEMATRIX]---,,, merovingian-pc,,neo,thematrix theoracle-pc,,neo,thematrix thesource-pc,,neo,thematrix ---,,, ---[ZION]---,,, cypher-lt,,neo,thematrix morpheus-pc,,neo,thematrix tank-lt,,neo,thematrix trinity-pc,,neo,thematrix 

修改了v0.3代码:

 ' CreateTSMMC.vbs ' Script to re-create tsmmc entries in order ' Author: Brett Clarke http://twistingthewick.org ' Version: 0.1 – 21/06/2007 ' ' Updated by Brian Travis, adding login and drive info ' Version: 0.2 - 2009-08-26 ' ' Updated by Jack Hamilton, to make it work in Remote Desktops v5.2.3790.0 ' Version: 0.3 - 2012-08-15 ' ' NOTES: ' (1) If you get subscript out of range error, check your CSV for any blank lines ' or lines with too many commas and fix/delete them. ' ' (2) Be sure to close all programs before running, especially those like email ' or instant messaging that can pop up a notification window causing the ' window focus to change and thereby interrupt the automation process. '——————————————————————— 'Declare some variables Option Explicit Const ForReading = 1 Const Sleep_Long_Pause = 1500 Const Sleep_Between_Keys = 200 Dim objShell, objFSO, objFileCopy, objDictionary, objTextFile Dim strBlankMMC, strWorkingMMC, strTemplate, strNextLine Dim arrRDPList Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") Set objDictionary = CreateObject("Scripting.Dictionary") strBlankMMC = ".\blanktsmmc.msc" strWorkingMMC = "c:\windows\system32\tsmmc.msc" strTemplate = ".\tsmmc.csv" Set objFileCopy = objFSO.GetFile(strBlankMMC) Set objTextFile = objFSO.OpenTextFile (strTemplate, ForReading) ' copy the blank template file over the working file objFileCopy.Copy (strWorkingMMC) ' start up MMC objShell.Run "c:\windows\system32\tsmmc.msc" ' wait for the app to start Wscript.Sleep Sleep_Long_Pause ' get to the plugin objShell.SendKeys "{DOWN}" ' read the CSV file, and parse the entries into the MMC session Do Until objTextFile.AtEndOfStream strNextLine = objTextFile.ReadLine arrRDPList = Split(strNextLine , ",") if arrRDPList(0) = "---" Then Wscript.Sleep Sleep_Between_Keys ' create a new group objShell.SendKeys "%f" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "m" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "%d" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "rem" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "%a" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "%c" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{ENTER}" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{END}" Wscript.Sleep Sleep_Between_Keys Else Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "+{F10}" Wscript.Sleep Sleep_Between_Keys ' Add Connection objShell.SendKeys "A" Wscript.Sleep Sleep_Between_Keys ' IP/Hostname objShell.SendKeys arrRDPList(0) objShell.SendKeys "{TAB}" Wscript.Sleep Sleep_Between_Keys ' skip Browse button objShell.SendKeys "{TAB}" Wscript.Sleep Sleep_Between_Keys ' Description If arrRDPList(1) = "" Then objShell.SendKeys arrRDPList(0) Else objShell.SendKeys arrRDPList(1) End If Wscript.Sleep Sleep_Between_Keys ' Skip "Connect to Console" objShell.SendKeys "{TAB}" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{TAB}" Wscript.Sleep Sleep_Between_Keys ' Username objShell.SendKeys arrRDPList(2) Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{TAB}" Wscript.Sleep Sleep_Between_Keys ' Skip Password objShell.SendKeys "{TAB}" Wscript.Sleep Sleep_Between_Keys ' Domain objShell.SendKeys arrRDPList(3) ' Skip "Save Password" objShell.SendKeys "{TAB}" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{TAB}" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{ENTER}" Wscript.Sleep Sleep_Between_Keys end if Loop ' get back to left column objShell.SendKeys "+{TAB}" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "^s" WScript.Quit 

仅供参考,对于任何仍在使用Brett's&Brian's解决scheme的人,这里是我对Windows 7(64位,英寸)上远程桌面(tsmmc)的最新修改。

注:blanktsmmc文件不再需要。 与VB脚本位于同一目录中的tsmmc.csv格式仍然是相同的,其中desc,user,domain是可选的(只要保留为“server ,,,”)即可。 每个组的第一行是用于识别组的伪连接名称。 — ,,,表示应该创build一个新的RemoteDesktop组:

 ---[GroupA]---,,, server,desc,user,domain server,desc,user,domain ---,,, ---[GroupB]---,,, server,desc,user,domain server,desc,user,domain ---,,, ---[GroupC]---,,, server,desc,user,domain server,desc,user,domain 

 ' CreateTSMMC.vbs ' Script to re-create tsmmc entries in order ' Author: Brett Clarke http://twistingthewick.org ' Version: 0.1 – 21/06/2007 ' ' Updated by Brian Travis, adding login and drive info ' Version: 0.2 - 2009-08-26 ' ' Updated by Jack Hamilton, to make it work in Remote Desktops v5.2.3790.0 ' Version: 0.3 - 2012-08-15 ' ' Updated by Jack Hamilton, to allow more sleep on Remote Desktops launch ' to allow application to get focus before commands executed. ' Version: 0.4 - 2012-12-27 ' ' Updated by Jack Hamilton for Windows 7. You cannot ' overwrite c:\windows\system32\tsmmc.msc, so added step at the end ' where user is prompted to Save As. User can then just execute ' using the new msc filename or create shortcut. ' Version: 0.5 - 2013-01-09 ' ' NOTES: ' (1) If you get subscript out of range error, check your CSV for any blank lines ' or lines with too many commas and fix/delete them. ' ' (2) Be sure to close all programs before running, especially those like email ' or instant messaging that can pop up a notification window causing the ' window focus to change and thereby interrupt the automation process. ' '——————————————————————— 'Declare some variables Option Explicit Const ForReading = 1 Const Sleep_Long_Pause = 1000 Const Sleep_Between_Keys = 250 Dim objShell, objFSO, objFileCopy, objDictionary, objTextFile Dim strWorkingMMC, strTemplate, strNextLine Dim arrRDPList Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") Set objDictionary = CreateObject("Scripting.Dictionary") strWorkingMMC = "c:\windows\system32\tsmmc.msc" strTemplate = ".\tsmmc.csv" Set objTextFile = objFSO.OpenTextFile (strTemplate, ForReading) ' start up MMC objShell.Run strWorkingMMC ' wait for the app to start ' NOTE: We need to have enough time for the ' Remote Desktops application to launch ' else MANY weird, bad things can happen ' if we don't have focus on the application ' else random commands start getting executed. ' Add more sleeps if app is slow to launch ' on this particular PC. Wscript.Sleep (Sleep_Long_Pause * 5) ' get to the plugin objShell.SendKeys "{DOWN}" ' read the CSV file, and parse the entries into the MMC session Do Until objTextFile.AtEndOfStream strNextLine = objTextFile.ReadLine arrRDPList = Split(strNextLine , ",") if arrRDPList(0) = "---" Then ' create a new group ' Open File Menu Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "%f" ' Add/Remove Snap-In Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "m" ' Highlight Remote Desktops Snap-In Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "Remote Desktops" ' Add the highlighted available snap-in on left column ' over to the right-column Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "%a" ' Click OK Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{ENTER}" ' Move to bottom snap-in Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{END}" ' End create new group Else ' Create new server connection ' Show Menu Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "+{F10}" ' Add Connection Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "A" ' IP/Hostname Wscript.Sleep Sleep_Between_Keys If arrRDPList(1) = "" Then objShell.SendKeys arrRDPList(0) Else objShell.SendKeys arrRDPList(1) End If ' Tab Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{TAB}" ' Username, Domain Info Wscript.Sleep Sleep_Between_Keys If arrRDPList(3) = "" Then ' Just Username, No Domain objShell.SendKeys arrRDPList(2) Else ' Username@Domain objShell.SendKeys arrRDPList(2) objShell.SendKeys "@" objShell.SendKeys arrRDPList(3) End If ' Tab Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{TAB}" ' Save Password Wscript.Sleep Sleep_Between_Keys objShell.SendKeys " " ' Tab Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{TAB}" ' Browse button (skip) Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{TAB}" ' Description Wscript.Sleep Sleep_Between_Keys If arrRDPList(1) = "" Then objShell.SendKeys arrRDPList(0) Else objShell.SendKeys arrRDPList(1) End If ' Skip "Connect to Console (w /admin option)" Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{TAB}" ' Click OK Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "{ENTER}" ' End create new server connection end if Loop ' Return to left-side column Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "+{TAB}" ' Open File Menu Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "%f" ' Open Save As to prompt user to save with new name. Wscript.Sleep Sleep_Between_Keys objShell.SendKeys "a" ' Quit Program Wscript.Sleep Sleep_Between_Keys WScript.Quit 

在tsmmc.msc中有一个可以修改的部分。 如果添加另一个stringID =“#”,那么您可以将该ID与任何string名称=“名称”ID =#