PowerShell script to detect CWA version and notify end user
If you are running Microsoft Teams in a Citrix environment you know you need to have the correct version of the Citrix Workspace App (CWA). If the version is to old users don’t have an optimized Teams and so Audio/Video will not be great and more server resources are being used.
This PowerShell script will help you with that issue. You can add it to the logon script or use it to startup Teams. (then you need to tweak it a little bit though).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
<# This script checks the used CWA version for a minimum version. If the used version is to old a popup will be shown asking to upgrade. Version : 1.2 Date : 7 March 2021 Created by : Jeroen Tielen - Tielen Consultancy Email : jeroen@tielenconsultancy.nl History: 1.0 : 10 November 2020 - Initial setup script. 1.1 : 02 December 2020 - Added PresentationFramework for machines not showing the warning box. 1.2 : 07 March 2021 - Added HTML5. #> $InfoFromRegistry = Get-ItemProperty -Path HKLM:\SOFTWARE\Citrix\ICA\Session $ClientVersion= $InfoFromRegistry.ClientVersion $ClientPlatform = $InfoFromRegistry.ClientProductID # ClientProductID 1=Windows, 257=HTML5, 81=Linux, 82=Macintosh # These are the minimum versions which support Teams offloading. $MinimumWindowsVersion = "19.11.0.50" $MinimumMacVersion = "20.9.0.17" $MinimumLinuxVersion = "20.06.0.15" Write-Host Client version in use: $Session.ClientVersion Add-Type -AssemblyName PresentationFramework IF ($ClientPlatform -eq "1") { Write-Host "Running Windows" IF ([version]$ClientVersion -ge [version]$MinimumWindowsVersion) { Write-Host "OK, running correct version of Citrix Workspace App." } ELSE { [System.Windows.MessageBox]::Show("Warning: `n`nYou dont have the correct version of the Citrix Workspace App installed on the endpoint. Microsoft Teams will not run in HDX optimised mode.`n`nGo to https://receiver.citrix.com to download the latest version on your endpoint or contact your servicedesk.",'Update Citrix Workspace App','OK','WARNING') } } IF ($ClientPlatform -eq "82") { Write-Host "Running Macintosh" IF ([version]$ClientVersion -ge [version]$MinimumMacVersion) { Write-Host "OK, running correct version of Citrix Workspace App." } ELSE { [System.Windows.MessageBox]::Show("Warning:`n`nYou dont have the correct version of the Citrix Workspace App installed on the endpoint. Microsoft Teams will not run in HDX optimised mode.`n`nGo to https://receiver.citrix.com to download the latest version on your endpoint or contact your servicedesk.",'Update Citrix Workspace App','OK','WARNING') } } IF ($ClientPlatform -eq "81") { Write-Host "Running Macintosh" IF ([version]$ClientVersion -ge [version]$MinimumLinuxVersion) { Write-Host "OK, running correct version of Citrix Workspace App." } ELSE { [System.Windows.MessageBox]::Show("Warning:`n`nYou dont have the correct version of the Citrix Workspace App installed on the endpoint. Microsoft Teams will not run in HDX optimised mode.`n`nGo to https://receiver.citrix.com to download the latest version on your endpoint or contact your servicedesk.",'Update Citrix Workspace App','OK','WARNING') } } IF ($ClientPlatform -eq "257") { Write-Host "Running HTML5" [System.Windows.MessageBox]::Show("Warning:`n`nYou are working via HTML5 in this Citrix session. Install the Citrix Workspace App on your endpoint so you can use Microsoft Teams in HDX optimised mode.`n`nGo to https://receiver.citrix.com to download the latest version on your endpoint or contact your servicedesk.",'Update Citrix Workspace App','OK','WARNING') } |
Yeah I know, I could shorten the script 😉 Have fun with it and leave a comment when using it or when having issues.
Yes, you need to run it IN the HDX session.
0 Comments