当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 将 RDS 角色(连接代理、Web 访问)迁移到另一台服务器

作者:精品下载站 日期:2024-12-14 23:30:17 浏览:16 分类:玩电脑

将 RDS 角色(连接代理、Web 访问)迁移到另一台服务器


本指南应帮助您将远程桌面连接代理和 RDS Web 访问角色迁移(移动)到另一台服务器。在此示例中,我们将把 RDS 连接代理角色从 Windows Server 2012 R2 主机迁移到 Windows Server 2019。我们还将了解迁移 RD Web 访问角色的具体细节。

RDS 场中 Windows Server 版本的一些兼容性限制

  • 更新 Windows Server 版本时,从具有 RD 连接代理角色的主机开始;

    如果您使用高可用性 RD 连接代理部署,则只需在群集中保留一台具有连接代理角色的主机,执行 Windows Server 版本的就地升级,然后升级其他主机,并将它们添加到群集中即可。

  • 终端场可以包含具有不同 Windows Server 版本 (2019/2016/2012R2) 的 RDSH 主机。建议在同一 RDS 集合中使用具有相同版本 Windows Server 的主机。这意味着您可以创建两个 RDS 集合,例如,一个包含 Windows Server 2019 主机,另一个包含 Windows Server 2012 R2 主机;

  • 具有早期 Windows Server 版本的 RDS 主机可以将连接代理与较新版本的操作系统一起使用(例如,运行 WS2012R2 或 WS2016 的 RDS 主机可以将 RD 连接代理与 WS2019 一起使用,但反之则不然)。

  • 在 RDSH 主机上升级 Windows Server 版本时,请务必在最新版本的 Windows Server 上安装 RDS 许可服务器并激活新的 RDS CAL。

就我而言,两台 RDS 主机正在运行 Windows Server 2012 R2:

  • Rds2

    - 具有 RD 连接代理、Web 访问和 RDSH 角色

  • Rds1

    - 具有 RDSH 角色

您可以使用本指南迁移独立的 RDSH 服务器。

您可以使用服务器管理器或 PowerShell 列出 RDS 部署中的角色:

Get-RDServer

[玩转系统] 将 RDS 角色(连接代理、Web 访问)迁移到另一台服务器

该任务是将连接代理角色以及已配置的 RemoteApp 和 RDS 集合迁移到新的 Windows Server 2019 主机(就地升级不适用)。

准备一台装有 Windows Server 2019 的新主机,并在其上安装 RD 连接代理和 RD 许可角色(如果需要)。

Windows Server 没有内置工具来轻松在主机之间传输配置的 RDS 角色。

要导出/导入当前 RDCB 设置,您可以使用 PowerShell 库中的 ExportImportRdsDeployment 模块。

默认情况下,RDCB 使用本地 SQL 数据库(Windows 内部数据库)来存储其设置(

C:\Windows\rdcbDb

\)。

从 PowerShell 库安装 ExportImportRdsDeployment 模块(您还可以离线安装 PowerShell 模块):

Install-Module ExportImportRdsDeployment -Force
Import-Module ExportImportRdsDeployment

如果 Windows Server 2012 R2 上未安装 Windows Management Framework 5.1(包括 Windows PowerShell 5.1),则运行命令时将看到以下错误:

Install-Module : The term 'Install-Module' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

下载并安装 KB3191564 (https://www.microsoft.com/en-us/download/details.aspx?id=54616) 以将 PowerShell 版本更新到 5.1。

如果运行命令时收到 Install-Module: Unable to download from URI 错误,则需要为 PowerShell 连接启用 TLS 1.2 协议:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

将 RDS 集合导出到 XML 文件:

Export-RDCollectionsFromConnectionBroker -ConnectionBroker localhost -XMLFile c:\ps\rdsoldcol.xml -verbose

[玩转系统] 将 RDS 角色(连接代理、Web 访问)迁移到另一台服务器

然后导出您的 RDS 配置(包括部署中的服务器列表):

Export-RDDeploymentFromConnectionBroker -ConnectionBroker localhost -XMLFile c:\ps\rdsdeployment.xml -Verbose

如果您在旧 RDS 服务器上使用通配符证书,请将其导出到 PFX 中(使用密码)。

将这两个文件复制到运行 Windows Server 2019 的新 RDS 服务器。此外,安装该模块:

Install-Module ExportImportRdsDeployment -Force

在此示例中,我正在迁移没有证书的 RDS 配置,因此我指定了不存在的文件。如果您在 RDS 部署中使用证书,请提供您的文件路径和密码。

然后运行以下命令:

$RDGatewayCertPath = "C:\PS\nocert.pfx"
$RDWebAccessCertPath = "C:\PS\nocert.pfx"
$RDRedirectorCertPath = "C:\PS\nocert.pfx"
$RDPublishingCertPath = "C:\PS\nocert.pfx "
$RDGatewayCertPassword = ConvertTo-SecureString -String "nopass" -AsPlainText -Force
$RDWebAccessCertPassword = ConvertTo-SecureString -String "nopass" -AsPlainText -Force
$RDRedirectorCertPassword = ConvertTo-SecureString -String "nopass" -AsPlainText -Force
$RDPublishingCertPassword = ConvertTo-SecureString -String "nopass" -AsPlainText -Force
Import-RDDeploymentToConnectionBroker -ConnectionBroker localhost -XmlFile c:\ps\rdsdeployment.xml -RDGatewayCertPath $RDGatewayCertPath -RDGatewayCertPassword $RDGatewayCertPassword -RDWebAccessCertPath $RDWebAccessCertPath -RDWebAccessCertPassword $RDWebAccessCertPassword -RDRedirectorCertPath $RDRedirectorCertPath -RDRedirectorCertPassword $RDRedirectorCertPassword -RDPublishingCertPath $RDPublishingCertPath -RDPublishingCertPassword $RDPublishingCertPassword -Verbose

[玩转系统] 将 RDS 角色(连接代理、Web 访问)迁移到另一台服务器

如果您没有使用 RDS 证书,您将看到一条警告,指出未找到文件。忽略这个错误。

跑过

Get-RDServer

命令并确保 RD 连接代理角色位于新服务器上。

[玩转系统] 将 RDS 角色(连接代理、Web 访问)迁移到另一台服务器

导入 RDS 集合:

Import-RDCollectionsToConnectionBroker -ConnectionBroker localhost -XmlFile "C:\PS\rdsoldcol.xml" -Verbose

确保具有配置的权限和远程应用程序的所有 RD 集合都出现在 RDS 管理控制台中。

[玩转系统] 将 RDS 角色(连接代理、Web 访问)迁移到另一台服务器

使用服务器管理器或 Remote-WindowsFeature 命令删除先前 WS2012R2 主机上的 RDCB 角色:

Remove-WindowsFeature RDS-Connection-Broker

[玩转系统] 将 RDS 角色(连接代理、Web 访问)迁移到另一台服务器

迁移已配置的RD Web 访问角色时存在一些细微差别。如果您要在不同的 Windows Server 版本(具有不同的 IIS 版本)之间移动 RDWebAccess 角色,则必须手动复制设置。

    1. 安装 RDS-Web-Access 角色并将新服务器添加到您的 RDS 场:

    2. Install-WindowsFeature RDS-Web-Access
  1. 导入证书(如果需要);

  2. 您可以使用 Microsoft Web Deploy v3.6 在具有相同 Windows Server 版本的服务器之间复制 RDWeb 站点设置。在两台主机上下载并安装 WebDeploy_amd64_en-US 软件包 (https://www.microsoft.com/en-us/download/details.aspx?id=43717);

  3. 要脱机传输 IIS 站点设置,您可以使用以下命令:

    cd "C:\Program Files (x86)\IIS\Microsoft Web Deploy V3"

    在源主机上:

    msdeploy -verb:sync -source:apphostconfig="Default Web Site" -dest:archivedir=c:\ps\rdweb

    在目标主机上:

    msdeploy -verb:sync -source:archivedir=c:\ps\rdweb -dest:appHostConfig="Default Web Site"

    您还可以使用 IIS 备份功能。

确保已应用您的自定义 IIS 设置(包括 RD Web 访问的过期密码更改表单)。同样,您可以迁移远程桌面网关角色。

如果 RD Web 访问服务器的 URL 地址已更改,请务必在 RDS 单点登录策略中进行更改。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯