You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将MremoteNG中的会话导出至RDCman?

解决MRemote连接迁移至RDCMan的方法

手动迁移(适合少量连接)

  • 先从MRemote导出XML格式的连接文件(比CSV包含更全的连接配置信息)
  • 打开RDCMan,新建一个空白的RDG组
  • 逐个把MRemote里的连接属性(主机名/IP、用户名、端口、备注等)复制到RDCMan的新建连接中就行

脚本批量转换(适合大量连接)

因为RDG本质是特定结构的XML文件,我们可以写脚本读取MRemote的XML导出文件,直接生成符合RDCMan要求的RDG文件:

  1. 从MRemote导出XML格式的连接列表,命名为mremote_connections.xml
  2. 用下面的Python脚本处理:
import xml.etree.ElementTree as ET
from xml.dom import minidom

# 解析MRemote的XML导出文件
tree = ET.parse('mremote_connections.xml')
root = tree.getroot()

# 初始化RDG文件的根结构
rdg_root = ET.Element('RDCMan')
file_node = ET.SubElement(rdg_root, 'file')
import_group = ET.SubElement(file_node, 'group', name='从MRemote导入的连接')

# 遍历所有MRemote连接
for conn in root.findall('.//Connection'):
    conn_name = conn.find('Name').text
    conn_host = conn.find('Hostname').text
    conn_user = conn.find('Username').text
    conn_pwd = conn.find('Password').text  # 注意:这里的密码可能是加密的,需要先解密

    # 创建RDCMan的服务器节点
    server = ET.SubElement(import_group, 'server', name=conn_name)
    ET.SubElement(server, 'displayName').text = conn_name
    ET.SubElement(server, 'serverName').text = conn_host
    if conn_user:
        ET.SubElement(server, 'logonCredentials', inherit='None')
        ET.SubElement(server, 'userName').text = conn_user
        if conn_pwd:
            ET.SubElement(server, 'password').text = conn_pwd

# 格式化XML并保存为RDG文件
raw_xml = ET.tostring(rdg_root, 'utf-8')
formatted_xml = minidom.parseString(raw_xml).toprettyxml(indent='  ')
with open('mremote_imported.rdg', 'w', encoding='utf-8') as f:
    f.write(formatted_xml)
  • 注意点:
    • MRemote导出的密码大概率是加密状态,脚本里读出来的是密文,得先在MRemote里确认明文密码(或者找MRemote的解密工具处理)再写入
    • 确保电脑上装了Python,直接运行脚本就能生成RDG文件,打开RDCMan导入这个文件就行
    • 如果需要调整更多连接属性(比如端口、网关),可以在脚本里对应添加RDCMan的节点字段

额外提示

RDCMan的RDG是标准XML,除了Python,你也可以用PowerShell、C#之类的语言写转换脚本,只要匹配它的节点结构就能被识别。如果只有CSV导出文件,也可以先把CSV转成XML再按上面的方法处理,但XML格式的信息更完整,优先用XML导出。

内容的提问来源于stack exchange,提问作者Racer SQL

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 00:52:43