Session Recording

Sessions are not recording

If application sessions are not recording successfully, check the application event log in the Event Viewer on the Session Recording agent and Session Recording server. Doing so can provide valuable diagnostic information.

If sessions are not recording, the possible cause might be:

  • Component connectivity and certificates. If the Session Recording components cannot communicate with each other, session recording can fail. To troubleshoot recording issues, verify that all components are configured correctly to point to the correct machines and that all certificates are valid and correctly installed.
  • Non-Active Directory domain environments. Session Recording is designed to run in a Microsoft Active Directory domain environment. If you are not running in an Active Directory environment, you might experience recording issues. Ensure that all Session Recording components are running on machines that are members of an Active Directory domain.
  • Session sharing conflicts with the active policy. Session Recording matches the active policy with the first published application that a user opens. Subsequent applications opened during the same session continue to follow the policy that is in force for the first application. To prevent session sharing from conflicting with the active policy, publish the conflicting applications on separate multi-session OS VDAs.
  • Recording is not enabled. By default, installing the Session Recording Agent on a multi-session OS VDA enables recording for the VDA. Recording does not occur until an active recording policy is configured to allow it.
  • The active recording policy does not permit recording. A session can be recorded only when the session meets the rules of the active recording policy.
  • Session Recording services are not running. For sessions to be recorded, the Session Recording Agent service must be running on a multi-session OS VDA and the Session Recording Storage Manager service must be running on the machine hosting the Session Recording Server.
  • MSMQ is not configured. If MSMQ is not correctly configured on the server running the Session Recording Agent and the machine hosting the Session Recording Server, recording problems might occur.
  • The Session Recording database component is not upgraded properly. When you upgrade an existing installation, you must follow the upgrade sequence strictly. If you have more than one Session Recording server in your deployment, you must first upgrade the Session Recording server where the Session Recording database component is installed. If not, session recording fails. To correct the issue of the Session Recording database component not being upgraded properly, perform either of the following actions:

    • Locate the Session Recording server where the Session Recording database component is installed. Then run the Citrix Virtual Apps and Desktops ISO or the SessionRecordingAdministrationx64.msi package on it.

    • Run the following script on any of the Session Recording servers in your deployment. When running the script, provide the path to the SessionRecordingAdministrationx64.msi package as a parameter.

       Add-Type -AssemblyName System.Data
       if (!(Test-Path "$PSScriptRoot\bin\lessmsi.exe")) {
           Write-Error "Download zip of binaries from and extract to \bin in this folder!"
       # Open MSI database
       $msi = New-Object -ComObject WindowsInstaller.Installer
       $msidb = $msi.OpenDatabase($Installer, 0)
       # Query File table
       $query = "SELECT Version FROM File WHERE FileName = 'SMAUDD~1.DLL|SsRecDatabase.dll'"
       $view = $msidb.OpenView($query)
       # Get DLL version
       $record = $view.Fetch()
       $version = $record.GetType().InvokeMember("StringData", "GetProperty", $null, $record, 1)
       $parts = $version.Split(".")
       [int] $major = $parts[0]
       [int] $minor = $parts[1]
       $majorMinor = $parts[0..1] -join "."
       $versionCompare = $major * 100 + $minor
       # Get db instance and name
       $registryKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("SOFTWARE\\Citrix\\SmartAuditor\\Server")
       $dbName = $registryKey.GetValue("DatabaseName")
       $dbInstance = $registryKey.GetValue("SmAudDatabaseInstance")
       write-host "Upgrade db($dbInstance\$dbName) to version $version"
       $schemaVersionMap = @{}
       $schemaVersionMap["19.12"] = ""
       $schemaVersionMap["22.3"] = ""
       $schemaVersionMap["22.6"] = ""
       $schemaVersionMap["22.9"] = ""
       $schemaVersionMap["22.12"] = ""
       $schemaVersionMap["23.3"] = ""
       $schemaVersionMap["23.5"] = ""
       $schemaVersionMap["23.8"] = ""
       $DBSchemaUpdatePatchList = @(
       $currentSchemaVersion = $schemaVersionMap[$majorMinor]
       # Connect db
       $conn = New-Object System.Data.SqlClient.SqlConnection
       $conn.ConnectionString = "workstation id=.;packet size=4096;integrated security=SSPI;data source=$dbInstance;persist security info=True;initial catalog=$dbName"
       # Open connection
       # Get existing db schema version
       $cmdGetSchema = $conn.CreateCommand()
       $cmdGetSchema.CommandType = [System.Data.CommandType]::StoredProcedure
       $cmdGetSchema.CommandText = "[GetSchemaVersion]"
       $out1 = $cmdGetSchema.Parameters.Add("@Major", [System.Data.SqlDbType]::Int)
       $out1.Direction = [System.Data.ParameterDirection]::Output
       $out2 = $cmdGetSchema.Parameters.Add("@Minor", [System.Data.SqlDbType]::Int)
       $out2.Direction = [System.Data.ParameterDirection]::Output
       $out3 = $cmdGetSchema.Parameters.Add("@Build", [System.Data.SqlDbType]::Int)
       $out3.Direction = [System.Data.ParameterDirection]::Output
       $out4 = $cmdGetSchema.Parameters.Add("@Revision", [System.Data.SqlDbType]::Int)
       $out4.Direction = [System.Data.ParameterDirection]::Output
       $existDbSchemaVersion = [string]::Format("{0}.{1}.{2}.{3}", $out1.Value, $out2.Value, $out3.Value, $out4.Value)
       write-host "Existing DB Schema Version: $existDbSchemaVersion"
       if ([string]::Compare($existDbSchemaVersion, $currentSchemaVersion) -lt 0) {
           Write-Output "Upgrade $existDbSchemaVersion to $currentSchemaVersion"
           & $PSScriptRoot\bin\lessmsi.exe x $Installer $PSScriptRoot\ SsRecDatabase.dll
           $tempdir = "$PSScriptRoot\SOURCEDIR\Program Files\Citrix\SessionRecording\Database\Bin"
           # Load assembly and get resource
           $asm = [Reflection.Assembly]::LoadFile("$tempdir\SsRecDatabase.dll")
           foreach ($patch in $DBSchemaUpdatePatchList) {
               if ([string]::Compare($existDbSchemaVersion, $patch) -le 0 -and [string]::Compare($patch, $currentSchemaVersion) -lt 0) {
                   write-host "Applying $patch"
                   # switch to db
                   $switchCmd = $conn.CreateCommand()
                   $switchCmd.CommandText = "use [$dbName]"
                   $resStream = $asm.GetManifestResourceStream("SmAudDatabase.$patch-MigrateDatabase.sql")
                   $bytes = New-Object byte[] $resStream.Length
                   $resStream.Read($bytes, 0, $resStream.Length)
                   $script = [System.Text.Encoding]::UTF8.GetString($bytes)
                   $statements = [regex]::Split($script, "\s[gG][oO]\s")
                   foreach($statement in $statements) {
                       $upgradeCmd = $conn.CreateCommand()
                       $upgradeCmd.CommandText = $statement
                   $existDbSchemaVersion = $patch
               } else {
                   write-host "Skip $patch"
           # UpdateStaticData
           $staticCmd = $conn.CreateCommand()
           $staticCmd.CommandText = "use [$dbName];if not exists(select * from [dbo].[StartReason] where ID=4) begin insert [dbo].[StartReason] values(4, 'Event Triggered') end"
           if ($versionCompare -ge 2308) {
               # upgrade record policy version
               $staticCmd = $conn.CreateCommand()
               $staticCmd.CommandText = "update [dbo].[PolicyDocument] set PolicyFileFormatMajorVersion = 1, PolicyFileFormatMinorVersion = 3 where SystemDefined = 1"
               # upgrade endreason
               $staticCmd = $conn.CreateCommand()
               $staticCmd.CommandText = "if not exists(select * from [dbo].[EndReason] where ID=5) begin insert [dbo].[EndReason] values(5 , 'Dormant') end"
           if ($versionCompare -ge 2311) {
               # upgrade endreason
               $staticCmd = $conn.CreateCommand()
               $staticCmd.CommandText = "if not exists(select * from [dbo].[EndReason] where ID=6) begin insert [dbo].[EndReason] values(6 , 'Deny') end"
           write-host "Upgrade success!"
       else {
           Write-Output "Current schema version don't need upgrade"
Sessions are not recording

In this article