The Complete Guide to Citrix Session Recording

An article by Trond Eirik Haavarstein from xenappblog

With this week release of Feature Pack 2 for Citrix XenApp and XenDesktop 7.6 also comes Citrix Session Recording 7.6.100.

This piece of software was the missing part of my upcoming release of Automation Framework 3.0, so I went on a mission to get it automated.

I immediately stumbled upon this blog post from Citrix Virtualization SE Georg Kuruvilla, and as he says “the installation process was a little tedious“!

Add missing eDoc information to the mix and you get the picture. Let’s get started!

Session Recording Player

Write-Verbose "Setting Arguments" -Verbose
$StartDTM = (Get-Date)

$Vendor = "Citrix"
$Product = "Session Recording Player"
$PackageName = "SessionRecordingPlayer"
$Version = "7.6.100"
$InstallerType = "msi"
$LogPS = "${env:SystemRoot}" + "Temp$Vendor $Product $Version PS Wrapper.log"
$LogApp = "${env:SystemRoot}" + "Temp$PackageName.log"
$UnattendedArgs = "/i $PackageName.$InstallerType ALLUSERS=1 /qn /liewa $LogApp"

Start-Transcript $LogPS

CD $VersionPlayer

Write-Verbose "Starting Installation of $Vendor $Product $Version" -Verbose
(Start-Process msiexec.exe -ArgumentList $UnattendedArgs -Wait -Passthru).ExitCode

Write-Verbose "Customization" -Verbose

Write-Verbose "Stop logging" -Verbose
$EndDTM = (Get-Date)
Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalSeconds) Seconds" -Verbose
Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalMinutes) Minutes" -Verbose
Stop-Transcript

Session Recording Agent

Write-Verbose "Setting Arguments" -Verbose
$StartDTM = (Get-Date)

$Vendor = "Citrix"
$Product = "Session Recording Agent"
$PackageName = "SessionRecordingAgentx64"
$Version = "7.6.100"
$InstallerType = "msi"
$LogPS = "${env:SystemRoot}" + "Temp$Vendor $Product $Version PS Wrapper.log"
$LogApp = "${env:SystemRoot}" + "Temp$PackageName.log"
$UnattendedArgs = "/i $PackageName.$InstallerType ALLUSERS=1 sessionrecordingservername=csr-01.ctxlab.vmw sessionrecordingbrokerprotocol=https sessionrecordingbrokerport=443 /qn /liewa $LogApp"

Start-Transcript $LogPS

Write-Verbose "Installing Prerequisites"
Install-WindowsFeature -Name MSMQ
Install-WindowsFeature -Name MSMQ-HTTP-Support

CD $VersionAgent

Write-Verbose "Starting Installation of $Vendor $Product $Version" -Verbose
(Start-Process msiexec.exe -ArgumentList $UnattendedArgs -Wait -Passthru).ExitCode

Write-Verbose "Customization" -Verbose

Write-Verbose "Stop logging" -Verbose
$EndDTM = (Get-Date)
Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalSeconds) Seconds" -Verbose
Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalMinutes) Minutes" -Verbose
Stop-Transcript

Session Recording Administration

#1 Install Windows Features

powershell.exe Add-WindowsFeature Web-Windows-Auth,Web-Asp-Net,Web-Mgmt-Compat,Web-Metabase,Web-WMI,Web-Lgcy-Scripting,Web-Lgcy-Mgmt-Console,MSMQ,MSMQ-HTTP-Support,Web-Asp-Net45

#2 Download Microsoft SQL Server Express 2014

Write-Verbose "Setting Arguments" -Verbose
$StartDTM = (Get-Date)

$url = "http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAndTools%2064BIT/SQLEXPRWT_x64_ENU.exe"
$output = "$PSScriptRootSQLEXPRWT_x64_ENU.exe"
$start_time = Get-Date

$Vendor = "Microsoft"
$Product = "SQL Server Express"
$Version = "2014"
$LogPS = "${env:SystemRoot}" + "Temp$Vendor $Product $Version PS Wrapper.log"

Start-Transcript $LogPS

Write-Verbose "Start Downloading $Vendor $Product $Version" -Verbose

$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $output)
#OR
(New-Object System.Net.WebClient).DownloadFile($url, $output)

Write-Verbose "Stop logging" -Verbose
$EndDTM = (Get-Date)
Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalSeconds) Seconds" -Verbose
Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalMinutes) Minutes" -Verbose
Stop-Transcript

#3 Install Microsoft SQL Express 2014

@echo off
REM Batch Wrapper for MDT, Standalone and Chocolatey Installation - (C)2015 xenappblog.com 

pushd %~dp0

SET AppName=Microsoft SQL Server Express 2014
SET Version=2014

SET OPTIONS=
SET OPTIONS=/Q
SET OPTIONS=%OPTIONS% /ACTION=Install
SET OPTIONS=%OPTIONS% /FEATURES=SQL,SSMS
SET OPTIONS=%OPTIONS% /INSTANCENAME=SQLEXPRESS
SET OPTIONS=%OPTIONS% /SQLSVCACCOUNT="NT AUTHORITYNETWORK SERVICE"
SET OPTIONS=%OPTIONS% /SQLSYSADMINACCOUNTS="CTXLABAdministrator" "BUILTINAdministrators"
SET OPTIONS=%OPTIONS% /AGTSVCACCOUNT="NT AUTHORITYNetwork Service"
SET OPTIONS=%OPTIONS% /IACCEPTSQLSERVERLICENSETERMS
SET OPTIONS=%OPTIONS% /BROWSERSVCSTARTUPTYPE="Automatic"

cls
echo.
echo Installing %AppName%
echo.

cd %Version%
start /wait SQLEXPRWT_x64_ENU.exe %OPTIONS%

popd
endlocal

#4 Import and Bind SSL Certificate

Install-WindowsFeature -Name Web-Server -IncludeManagementTools
copy-item "\mdt-01mdtproduction$ApplicationsScriptswildcard.pfx" -Destination C:WindowsTempwildcard.pfx 

import-module webadministration
$PFXPath="C:WindowsTempwildcard.pfx"
$PFXPassword="Password"
$strThumb="656D9BCE52970C48E235B5C071861f546A7ADBA8"
 
certutil -f -importpfx -p $PFXPassword $PFXPath

Remove-Item C:WindowsTemp*.pfx -Force

Push-Location IIS:
cd SslBindings
New-webBinding -Name "Default Web Site" -IP "*" -Port 443 -Protocol https
get-item cert:LocalMachineMY$strThumb | new-item 0.0.0.0!443
Pop-Location

Get all the details in the post Securing Citrix X1 StoreFront with Powershell.

#5 Install Session Recording Administration

Write-Verbose "Setting Arguments" -Verbose
$StartDTM = (Get-Date)

$Vendor = "Citrix"
$Product = "Session Recording Administration"
$PackageName = "SessionRecordingAdministrationx64"
$Version = "7.6.100"
$InstallerType = "msi"
$LogPS = "${env:SystemRoot}" + "Temp$Vendor $Product $Version PS Wrapper.log"
$LogApp = "${env:SystemRoot}" + "Temp$PackageName.log"
$LogApp2 = "${env:SystemRoot}" + "TempBrokerPSSnapIn.log"
$Destination = "${env:ChocoRepository}" + "$Vendor$Product$Version$packageName.$installerType"
$UnattendedArgs = "/i $PackageName.$InstallerType ALLUSERS=1 DATABASEINSTANCE=.SQLEXPRESS DATABASEUSER=localhost DATABASECREATERUSERNAME=CTXLABADMINISTRATOR DATABASECREATERPWD=Brasil2015 ADDLOCAL=PolicyConsole,SsRecServer,StorageDatabase,RequiredResources /qb /liewa $LogApp"
$UnattendedArgs2 = "/i Broker_PowerShellSnapIn_x64.msi /qn /liewa $LogApp2"

Start-Transcript $LogPS

CD $VersionAdministration

Write-Verbose "Starting Installation of $Vendor $Product $Version" -Verbose
(Start-Process msiexec.exe -ArgumentList $UnattendedArgs2 -Wait -Passthru).ExitCode
(Start-Process msiexec.exe -ArgumentList $UnattendedArgs -Wait -Passthru).ExitCode

Write-Verbose "Customization" -Verbose

Write-Verbose "Stop logging" -Verbose
$EndDTM = (Get-Date)
Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalSeconds) Seconds" -Verbose
Write-Verbose "Elapsed Time: $(($EndDTM-$StartDTM).TotalMinutes) Minutes" -Verbose
Stop-Transcript

The rest is straight forward. Since the certificate is already installed, you just need to select it.

Citrix Session Recording 02

Citrix Session Recording 03

Set Citrix Session Recording Player permissions.

Citrix Session Recording 04

Set the policy you prefer.

Citrix Session Recording 05

Test it out.

Citrix Session Recording 06

I think the best option is to use the “Do not record” policy and enable recording through Citrix Director when needed. Run this command to configure Director integration.

C:inetpubwwwrootDirectortoolsDirectorConfig.exe /configsessionrecording

Citrix Session Recording 07

Citrix Session Recording is super helpful and if you’re licensed you should get it implemented during your next maintenance window.

Be Sociable, Share!
 

Tags: ,

Comments

No comments so far.

  • Leave a Reply
     
    Your gravatar
    Your Name