Session Recording

动态的会话录制

以前,会话录制会严格地在符合录制策略的会话的最开始启动,并且会在这些会话结束时严格地停止。

从 7.18 版本开始,Citrix 引入了动态会话录制功能。借助此功能,您可以在会话期间的任何时间启动或停止录制特定会话或特定用户启动的会话。

注意:

为确保此功能按预期运行,请将会话录制、VDA 和交付控制器升级到 7.18 或更高版本。

启用或禁用动态会话录制

在 Session Recording 代理上,添加了一个注册表值用于启用或禁用此功能。此注册表值默认设置为 1,这意味着此功能默认处于启用状态。

要启用或禁用此功能,请完成以下步骤:

  1. Session Recording 安装完成后,以管理员身份登录到安装了 Session Recording 代理的计算机。
  2. 打开注册表编辑器。
  3. 浏览到 HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\SmartAuditor
  4. DynamicControlAllowed 的值设置为 0 或使用默认值 11:启用动态录制 0:禁用动态录制
  5. 重新启动 Session Recording 代理以使您的设置生效。 如果您使用 MCS 或 PVS 进行部署,请更改主映像上的设置并执行更新以使您的更改生效。

警告:

错误地编辑注册表可能会导致严重问题,可能需要重新安装操作系统。Citrix® 无法保证可以解决因不正确使用注册表编辑器而导致的问题。请自行承担使用注册表编辑器的风险。在编辑注册表之前,请务必备份注册表。

使用 Citrix SDK 中的 PowerShell 命令动态启动或停止录制

You can use the dynamic session recording feature in both on-premises and Citrix Cloud environments. To use the feature in an on-premises environment, use the Citrix Virtual Apps and Desktops™ PowerShell SDK. To use the feature in a Citrix Cloud environment, use the Citrix Virtual Apps and Desktops Remote PowerShell SDK.

要确定要安装和使用哪个 SDK,请注意您在创建录制策略时指定的 Delivery Controller™。如果选中 Citrix Cloud Controller 复选框以在 Citrix Cloud 环境中录制会话,则必须验证您的 Citrix Cloud 凭据。

创建到控制器的查询(/zh-cn/session-recording/2201/media/create-query-to-ddc.png)

注意:

Do not install the Remote PowerShell SDK on a Citrix Cloud Connector™ machine. You can install the Remote PowerShell SDK on any domain-joined machine within the same resource location. We recommend that you do not run this SDK’s cmdlets on Cloud Connectors. The SDK’s operation does not involve the Cloud Connectors.

下表列出了两个 Citrix SDK 都为动态会话录制提供的三个 PowerShell 命令。

命令 Description
Start-BrokerSessionRecording 允许您开始录制特定的活动会话、活动会话列表或由特定用户启动的会话。有关详细信息,请运行 Get-Help Start-BrokerSessionRecording 以查看命令联机帮助。
停止-代理会话录制 允许您停止录制特定的活动会话、活动会话列表或由特定用户启动的会话。有关详细信息,请运行 Get-Help Stop-BrokerSessionRecording 以查看命令联机帮助。
获取-代理会话录制状态 允许您获取特定活动会话的录制状态。有关详细信息,请运行 Get-Help Get-BrokerSessionRecordingStatus 以查看命令联机帮助。

例如,当用户报告问题并需要及时支持时,您可以使用此功能动态开始录制用户的活动会话。您可以播放实时录制以进行后续故障排除。您可以执行以下操作:

  1. (For Citrix Virtual Apps™ and Desktops PowerShell SDK only) Launch PowerShell from the Citrix Studio console.

    Launch PowerShell

  2. 使用 Get-BrokerSession 命令获取目标用户的所有活动会话。

    运行获取代理会话

  3. 使用 Get-BrokerSessionRecordingStatus 命令获取指定会话的录制状态。

    运行获取会话状态

    注意:

    -Session 参数一次只能接受一个会话 UID。

  4. 使用 Start-BrokerSessionRecording 命令开始录制。默认情况下,将显示通知消息以告知用户录制活动。

    下表显示了使用 Start-BrokerSessionRecording 命令的常见方法。

    命令 详细信息
    Start-BrokerSessionRecording -User DomainA \ UserA 开始录制名为 DomainA 的域中用户 UserA 的所有会话,并通知 UserA。
    Start-BrokerSessionRecording -User DomainA \ UserA -NotifyUser $false 开始录制域 DomainA 中用户 UserA 的所有会话,并且不通知 UserA。
    Start-BrokerSessionRecording -Sessions $SessionObject 开始录制名为 $SessionObject 的对象中的所有会话,并通知用户。要获取对象 $SessionObject,请运行 $SessionObject=Get-BrokerSession –username UserA。对象名称以美元符号 $ 为前缀。有关详细信息,请参阅步骤 2 和命令联机帮助。
    Start-BrokerSessionRecording -Sessions uid1,uid2,…,uidn 开始录制会话 UID1UID2、… 和 UIDn,并通知用户。
  5. 使用 Get-BrokerSessionRecordingStatus 命令获取每个目标会话的录制状态。该状态应为 SessionBeingRecorded

  6. 播放 LiveComplete 录制件,然后进行后续故障排除。

    注意:

    当您播放由 Stop-BrokerSessionRecording 命令结束的 Complete 录制件时,播放器进度条上的时间线最后一部分可能会显示为灰色。并且,录制会话的最后一部分处于空闲状态。当录制会话持续活动时,这一点并不明显。

  7. 当报告的问题已分类或解决时,使用 Stop-BrokerSessionRecording 命令停止录制。

    下表显示了使用此命令的常见方法:

    命令 详细信息
    Stop-BrokerSessionRecording -User DomainA \ 用户A 停止录制域 DomainA 中用户 UserA 的所有会话。
    Stop-BrokerSessionRecording -Sessions $SessionObject 停止录制 $SessionObject 中的所有会话。
    Stop-BrokerSessionRecording -Sessions uid1,uid2,…,uidn 停止录制会话 UID1UID2、… 和 UIDn

在 Citrix Studio 的“日志记录”屏幕上,您可以查看 Start-BrokerSessionRecordingStop-BrokerSessionRecording 命令生成的日志。

Studio 日志记录屏幕(/zh-cn/session-recording/2201/media/citrix-studio-logging-screen.png)

动态的会话录制