Session Recording 2103

Dynamic session recording

Previously, session recording started strictly at the very beginning of sessions that met the recording policies and stopped strictly when those sessions ended.

Starting with the 7.18 release, Citrix introduces the dynamic session recording feature. With this feature, you can start or stop recording a specific session or sessions that a specific user launches, at any time during the sessions.

Note:

To make the feature work as expected, upgrade Session Recording, VDA, and Delivery Controller to Version 7.18 or later.

Enable or disable dynamic session recording

On the Session Recording Agent, a registry value is added for enabling or disabling the feature. The registry value is set to 1 by default, which means that the feature is enabled by default.

To enable or disable the feature, complete the following steps:

  1. After the Session Recording installation is complete, log on as an administrator to the machine where you installed the Session Recording Agent.
  2. Open the Registry Editor.
  3. Browse to HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\SmartAuditor.
  4. Set the value of DynamicControlAllowed to 0 or use the default value, 1.
    1: enable dynamic recording
    0: disable dynamic recording
  5. Restart the Session Recording Agent to make your setting take effect.
    If you are using MCS or PVS for deployment, change the setting on your master image and perform an update to make your change take effect.

Warning:

Incorrectly editing the registry can cause serious problems that might require you to reinstall your operating system. Citrix cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Be sure to back up the registry before you edit it.

Dynamically start or stop recording by using PowerShell commands in the Citrix SDKs

You can use the dynamic session recording feature in both on-premises and Citrix Cloud environments by using the Citrix Virtual Apps and Desktops PowerShell SDK and the Citrix Virtual Apps and Desktops Remote PowerShell SDK, respectively.

To determine which SDK to install and use, be aware of the Delivery Controller you specified when creating your recording policy. If you select the Citrix Cloud Controller check box to record sessions in a Citrix Cloud environment, you must validate your Citrix Cloud credentials. For more information, see Create a custom recording policy.

Create query to controller

Note:

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.

The following table lists three PowerShell commands that both Citrix SDKs provide for dynamic session recording.

Command Description
Start-BrokerSessionRecording Lets you start recording a specific active session, a list of active sessions, or sessions launched by a specific user. For more information, run Get-Help Start-BrokerSessionRecording to see the command online help.
Stop-BrokerSessionRecording Lets you stop recording a specific active session, a list of active sessions, or sessions launched by a specific user. For more information, run Get-Help Stop-BrokerSessionRecording to see the command online help.
Get-BrokerSessionRecordingStatus Lets you get the recording status of a specific active session. For more information, run Get-Help Get-BrokerSessionRecordingStatus to see the command online help.

For example, when a user reports an issue and needs timely support, you can use the feature to dynamically start recording the user’s active sessions and play back the live recording to proceed with the follow-up troubleshooting. You can do the following:

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

    Launch PowerShell

  2. Use the Get-BrokerSession command to get all the active sessions of the target user.

    Run get broker session

  3. Use the Get-BrokerSessionRecordingStatus command to get the recording status of the specified session.

    Run get session status

    Note:

    The -Session parameter can accept only one session Uid at a time.

  4. Use the Start-BrokerSessionRecording command to start recording. By default, a notification message appears to inform users of the recording activity. 

    The following table shows common ways of using the Start-BrokerSessionRecording command.

    Command Description
    Start-BrokerSessionRecording -User DomainA \ UserA Starts recording all sessions of user UserA in the domain named DomainA and notifies UserA.
    Start-BrokerSessionRecording -User DomainA \ UserA -NotifyUser $false Starts recording all sessions of user UserA in the domain named DomainA and does not notify UserA.
    Start-BrokerSessionRecording -Sessions $SessionObject Starts recording all sessions in the object named $SessionObject and notifies the user. To get the object $SessionObject, run $SessionObject=Get-BrokerSession –username UserA. The name of an object is prefixed with a dollar sign $. For more information, see Step 2 and the command online help.
    Start-BrokerSessionRecording -Sessions uid1,uid2,…,uidn Starts recording the sessions uid1, uid2, … , and uidn, and notifies the users.
  5. Use the Get-BrokerSessionRecordingStatus command to get the recording status of each target session. The status is supposed to be SessionBeingRecorded.

  6. Play back the Live or Complete recordings in the Session Recording Player and proceed with the follow-up troubleshooting.

    Note:

    The last section of the timeline on the Player progress bar might show gray when you play back a “Complete” recording ended by the Stop-BrokerSessionRecording command and the last section of the recorded session is idle. It is not obvious when the recorded session has constant activities.

  7. Use the Stop-BrokerSessionRecording command to stop recording when the reported issue has been triaged or resolved.

    The following table shows common ways of using this command:

    Command Description
    Stop-BrokerSessionRecording -User DomainA \ UserA Stops recording all sessions of user UserA in the domain named DomainA.
    Stop-BrokerSessionRecording -Sessions $SessionObject Stops recording all sessions in the $SessionObject.
    Stop-BrokerSessionRecording -Sessions uid1,uid2,…,uidn Stops recording the sessions uid1, uid2, … , and uidn.

On the Citrix Studio Logging screen, you can view the resulting logs of the Start-BrokerSessionRecording and Stop-BrokerSessionRecording commands.

Studio logging screen

Dynamic session recording