Automating the Lifecycle of Citrix Workspace

Featured image of post Automating the Lifecycle of Citrix Workspace

Automating the Lifecycle of Citrix Workspace

Version specific directories make this more challenging then it needs to be.

Introduction

I recently encountered an issue with a niche application accessed with Citrix Workspace. The company who provides this solution has specific requirements for the version of Citrix Workspace you use to access the software. There were 40 computers with various versions, paths, and settings that needed fixing.

Doing this by hand would not be realistic. Luckily, this environment uses Connectwise Automate so I can script all of this. This will work on other platforms, just with tweaks to platform specific terms. I would first need to uninstall any version of Citrix Workstation that was not 2404 LTSR, the specific version the host wanted. Then we would have to install the correct version with the specific settings required.

Uninstalling Citrix Workspace

Surprisingly this was the hardest part of this entire process. Every version of Citrix Workspace has a unique name, the version number is included. This means unique file paths and program names for every version. Powershell does not handle wildcards very well and would say it uninstalled the program but would not actually uninstall it.

I found a registry key that is the same for every version I tested of Citrix Workspace. This key lists the command to run when you click uninstall in Add/Remove Programs. In Automate, I use powershell to read that registry key and save it to a variable using this command:

1
(Get-ItemProperty -Path HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\CitrixOnlinePluginPackWeb -Name UninstallString).UninstallString

Then I run a shell command with that variable, but with /silent added ot the end. This installs whatever version the computer has, and does it in the background. This prevents pop ups that could alarm end users.

Installing Citrix Workspace

This part was very simple. Most options for Workspace can be set with flags. I downloaded the correct installer for Workspace and put it on the LabTech share so the script can pull it to workstations. The full command used is:

CitrixWorkspaceLTSR2402.exe /silent /noreboot /AutoUpdateStream=LTSR /AutoUpdateCheck=disabled

  • /silent Makes the install happen in the background
  • /noreboot So the workstations do not reboot after the install
  • /AutoUpdateStream=LTSR This makes sure the only updates the program will take are long term support releases, but this is just a backup. We will be disabling updates next.
  • /AutoUpdateCheck=disabled The program needs to stay on this version, so update checks are disabled.

Preventing Updates

All of this work to install the correct version could be undone if it updates. Update checks were disabled when the program was installed, but more can be done. Per documentation, we can disable updates with a registry key.

This registry was deployed to all workstations with Group Policy, but anything can be used to do that. In every available way, updates were disabled. If something happens and a setting changes, updates will still not happen.

Final Notes

You could also create dataviews to automate further. If Citrix Workspace is installed and it isnt 2402, run the uninstaller script. Then , if no Citrix Workspace is installed, run the installer script.

ConnectWise Automate does not do any kind of download sharing over LAN. If you run the installer script against 40 computers in one location, all 40 download the file. This can and will fully saturate a locations WAN connection if you are not careful.