Oct 272020

This document was built on Slack, Citrix URLs, and Citrix Consultants from the field that shared how they successfully were able to get teams working 100% within Citrix. If you disagree and find something different then let’s update it. But the information Is shared among many people and it is showing good results. I’ll try to keep it updated around new blogs and actual experience in the area of installing teams in a CVAD environment.

  1. Different installer for Teams
  • If you install Team.exe, this is the user installer. It will either install in the user profile or program data. 
  • If you install the MSI version of Team, this is the Machine Wide installer. Citrix states they need the machine-wide installer.
  1. Uninstall Teams per user -clean up and redeployment procedure
  • Uninstall user per team’s installer before proceeding on Team machine installer
  • You can have Citrix WEM run this for the user, inside their profile.
  • Location: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run
  • Option 1: 
  • %LOCALAPPDATA%\Microsoft\Teams\Update.exe –uninstall –msiUninstall –source=default
  • %Programdata%\Microsoft\Teams\Update.exe –uninstall –msiUninstall –source=default
  • C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -command set-executionpolicy bypass -Scope CurrentUser
  • C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -File “\\domain\NETLOGON\CitrixScripts\WemExternalTask\TeamsUninstall-Users\TeamsUser-Uninstall.ps1” -NoProfile -Noninteractive
  • But I changed the part in the Script to do it while the user is logged in.

$TeamsStartMenuShortcut = “c:\users\$env:USERNAME.$env:USERDOMAIN\Start Menu\Programs\Microsoft Corporation”

$TeamsDesktopShortcut = “c:\users\$env:USERNAME.$env:USERDOMAIN\Desktop\Microsoft


  • originally it was

$TeamsStartMenuShortcut = “\\domain\share\$env:USERNAME.$env:USERDOMAIN\Start Menu\Programs\Microsoft Corporation”

$TeamsDesktopShortcut = “\\domain\share\$env:USERNAME.$env:USERDOMAIN\Desktop\Microsoft Teams.lnk”

  • Then I used a WEM external Task to run it.
  1. Block user installs
  • Deny access to C:\Users\*\AppData\Local\Microsoft\Teams
  • Use Fslogix appmasking
  1. Citrix
  • Minimum Version1906.2:
  • Best results are 1912
  • Virions -Optimization for Microsoft Teams requires a minimum of Microsoft Teams version
  • We recommend you follow the Microsoft Teams machine-wide installation guidelines and avoid using the .exe installer that installs Teams in Appdata. Instead, install in C:\Program Files (x86)\Microsoft\Teams by using the ALLUSER=1 flag from the command line. In this mode, the 
  •  Teams application doesn’t auto-update whenever there is a new version. We recommend this mode for non-persistent environments. For more information, see Install Microsoft Teams using MSI (VDI Installation section).
  1. Microsoft VDI


These examples also use the ALLUSERS=1 parameter. When you set this parameter, Teams Machine-Wide Installer appears in Programs and Features in Control Panel and in Apps & features in Windows Settings for all users of the computer. All users can then uninstall Teams if they have admin credentials. It’s important to understand the difference between ALLUSERS=1 and ALLUSER=1. The ALLUSERS=1 parameter can be used in non-VDI and VDI environments and the ALLUSER=1 parameter is used only in VDI environments to specify a per-machine installation.

  1. Dedicated VDI (updated)

You have Windows 10 dedicated persistent VDI environments. You want the Teams application to auto-update and would prefer Teams to install per-user under Appdata/Local, use the .exe installer or the MSI without ALLUSER=1.  (I don’t know if they will be optimized for Citrix though?)

Updated 8/18/2020

I confirmed that it’s still optimized as well on the user install. I was wondering this and now I know.

Non-Presisten VDI or RDSH (XenApp)

ALLUSERS=1:  Teams Machine-Wide Installer appears in Programs and Features in Control Panel and in Apps

ALLUSER=1: used only in VDI environments to specify a per-machine installation

  1. Per-machine installation for VDI


“msiexec /i <path_to_msi> /l*v <install_logfile_name> ALLUSER=1 ALLUSERS=1

“msiexec /i Teams_windows_x64.msi ALLUSER=1 ALLUSERS=1”

  1. FSlogix Profile exclusions

<Exclude Copy=”0″>AppData\Local\Microsoft\Teams\Packages\SquirrelTemp</Exclude>

<Exclude Copy=”0″>AppData\Roaming\Microsoft\Teams\Service Worker\CacheStorage</Exclude>

<Exclude Copy=”0″>AppData\Roaming\Microsoft\Teams\Application Cache</Exclude>

<Exclude Copy=”0″>AppData\Roaming\Microsoft\Teams\Cache</Exclude>          

<Exclude Copy=”0″>AppData\Roaming\Microsoft Teams\Logs</Exclude>

<Exclude Copy=”0″>AppData\Roaming\Microsoft\Teams\media-stack</Exclude>

AppData\Local\Microsoft\Teams as it will break some pieces in the Citrix discussion below.


Source: https://virtualwarlock.net/microsoft-teams-in-citrix/

Source2: https://james-rankin.com/articles/quickpost-how-to-stop-fslogix-profile-containers-bloating-when-running-microsoft-teams/

  1. Warning and issues (Darn Json Files are just a pain and don’t seem to get honored very well.)

Running the MSI in VDI mode by using the switch Alluser=1 makes teams completely ignores the JSON files.  It ignores the setup.json and it ignores the desktop-config.json file. It must be a bug. Redirecting it to any other JSON file anywhere else won’t help as it doesn’t respect JSON files. Still trying to work through this.

  1.   Disable Teams auto-launch

Disable Teams auto-launch after installation

Delete Teams regkeys following locations

HKEY_LOCAL_MACHINE \SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run 

HKEY_LOCAL_MACHINE \SOFTWARE\Microsoft\Windows\CurrentVersion\Run

HKEY_CURRENT_USER \SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Then apply GPO not to auto Launch Teams. 

  • Note that currently, it is not possible to disable Auto-start even if using the command line flag OPTIONS=”noAutoStart=true” with the machine-wide MSI and the ALLUSER=1 property. Deleting the reg key described in bullet#2 should fix this.




  • If you have profiles that have auto-launch already set, then you will have to run this script to clear out the settings. If you want to use the “Prevent Microsoft Teams from starting automatically after installation. Group Policy setting, make sure you first set the Group Policy setting to the value you want before you run this script. 


  • Some are saying do the auto-launch with teams because it not as CPU intensive.

Source: https://virtualwarlock.net/microsoft-teams-in-citrix/

  1. James Ranklin method of disable auto-setup, enable auto-start once the setup is triggered manually by the user, and also make sure that the openAsHidden flag is actually respected.  Scroll down to “Solving It”
  1. Disable GPU offload, because teasm will have HIGH CPU usauge 

(Run this with WEM)

Source: https://www.itexperience.net/fix-performance-issues-teams-high-cpu-memory-usage/

Source: Slack

$ErrorActionPreference = ‘SilentlyContinue’

$JsonFile = [System.IO.Path]::Combine($Env:AppData, ‘Microsoft’, ‘Teams’, ‘desktop-config.json’)

$ConfigFile = Get-Content -Path $JsonFile -Raw | ConvertFrom-Json

Try {

    $ConfigFile.appPreferenceSettings.openAtLogin = $False

    $ConfigFile.appPreferenceSettings.disableGpu = $True

} Catch {

    Write-Host  “JSON element doesn’t exist”


$ConfigFile | ConvertTo-Json -Compress | Set-Content -Path $JsonFile -Force 

Update as of October 21st 2020.  This seems to work really well.


  • For this I did a WEM external Task that does the following

C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -command set-executionpolicy bypass -Scope CurrentUser

C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -File “\\domain.org\NETLOGON\CitrixScripts\WemExternalTask\DisableGPUTeams_VDI\disableGPUTeams.ps1” -NoProfile -Noninteractive

  1. Monitoring Teams with HDX Monitor

    On 1912 VDAs (or higher), you can monitor an optimized active call using HDX Monitor (3.5.2 or higher).
    To turn this on, create the following WebrtcDirectorIntegration regkey on the VDA:

    – reg key value:
    name: WebrtcDirectorIntegration
    type: DWORD
    value: enable(1), disable(0)
  1. Enable Team in Citrix

Enable optimization of Microsoft Teams

To enable optimization for Microsoft Teams, use the Studio policy described in Microsoft Teams redirection policy (it is ON by default). In addition to this policy being enabled, HDX checks to verify that the version of the Citrix Workspace app is equal to or greater than the minimum required version. If you enabled the policy and the Citrix Workspace app version is supported, the HKEY_CURRENT_USER\Software\Citrix\HDXMediaStream\MSTeamsRedirSupport registry key is set to 1 automatically on the VDA. The Microsoft Teams application reads the key to load in VDI mode.


If you are using version 1906.2 VDAs or higher with older Controller versions (for example, version 7.15), which do not have the policy available in Studio, you can still be optimized because HDX optimization for Microsoft Teams is enabled by default in the VDA.

If you click About > Version, the Citrix HDX Optimized legend displays:

Optimized for Citrix legend

Recommended version – Citrix Workspace app 2006.1 for Windows and Minimum version – Citrix Workspace app 1907 for Windows:

Source: https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/multimedia/opt-ms-teams.html

  1. Troubleshooting MS teams in Citrix


  1. To prevent Teams from installing in Office updates.

If your organization isn’t ready to deploy Teams and you use Group Policy, you can enable the Don’t install Microsoft Teams with new installations or updates of Office policy setting. You can find this policy setting under Computer Configuration\Policies\Administrative Templates\Microsoft Office 2016 (Machine)\Updates.

It will add this key.

All of this is references from Slack and conversations, virtual Warlock Site and Citrix Troubleshooting Docs


  1. Outlook Plugin appears to break at times or may never load.

For it not loading, Please follow Kasper’s guide here

Search for “Teams Outlook Add-in” on his page.

  1. Outlook Plugin appears to break at times and this is what I have found so fart that fixes it.

Copy the two folders from C:\Program Files (x86)\Microsoft “TeamMeetingAddin” and TeamsPresenceAdmin” to C:\Users\%username%\AppData\Local\Microsoft.
The run this
%SystemRoot%\System32\regsvr32.exe /s /n /i:user %LocalAppData%\Microsoft\TeamsMeetingAddin\1.0.19317.2\x64\Microsoft.Teams.AddinLoader.dll
%SystemRoot%\SysWOW64\regsvr32.exe /s /n /i:user %LocalAppData%\Microsoft\TeamsMeetingAddin\1.0.19317.2\x86\Microsoft.Teams.AddinLoader.dllthis version number in I pasted might be different, Based on what you have installed. (edited) 

Then about 5 minutes later, this was showing

Oct 232020

This quick write-up isn’t anything advanced. Most of you out there know this. But some may still question it. We know there is a lot of documentation around PVS and Martin Zugec is updating a lot of this within Citrix Tech Zone https://docs.citrix.com/en-us/tech-zone.html . This is more of a confirmation that running a defrag on the VHDX on a merged vDisk is still needed on today’s PVS server vDisk. I reached out to some guys on slack, as I knew I would get a solid answer fast. As you can see it is still needed. Some rebuild images, and some just do what I do. Which is a manual way. Which can be automated as well. Some people today may think, is this needed when I have SSD/NVMe. Yes, it is, because we are talking about all the version changes, and it’s the actual VHDX itself. Think of how you shrink FSLogix VHDX/VHD. To me, it’s the same concept. The type of storage doesn’t matter because it not at the OS layer. It’s about keeping the VHDX clean, optimized, and reducing and write cache bloats that will occurs of the fragmentation on the VHDX as a whole.

my advice is to read this blog, as it will shed a lot of light on what I am talking about and much more.


“Defragment the vDisk before deploying the image and after major changes. Defragmenting the vDisk resulted in write cache savings of up to 30% or more during testing. This will impact any of you who use versioning as defragmenting a versioned vDisk is not recommended. Defragmenting a versioned vDisk will create excessively large versioned disks (.AVHD files). Run defragmentation after merging the vDisk versions.Note: Defragment the vDisk by mounting the .VHD on the PVS server and running a manual defragmentation on it. This allows for a more robust defragmentation as the OS is not loaded. An additional 15% reduction in the write cache size was seen with this approach over standard defragmentation.

Here is a good script to defrag and shrink the vhdx

  1. Put the devices into maintenance mode in studio (No devices can be streaming of the vDisk to defrag the vDisk) 
  1. Make sure the connections say “0”
  1. You could copy the merged vDisk of and import it to do all the work if needed, Then you would need to mess with the active streaming devices. Then after your complete, just update all the targets. 
  2. But for this, I didn’t do it this way. But it’s an option.
  3. Make sure you have no locks either. As per my example, XD7CALLTST has none.
  4. Now merge the selected vDisk, 
  5. Select merged base -Last base + all updates from that base
  6. Then select the test mode
  1. Wait for the % to complete 100%
  1. Once it’s merged, it will look like this
  1. Now click on the vDisk and click mount
  1. The icon will look like this on the vDisk
  1. Now open up file explorer, and find the drive.
  1. Analyze it to see if it’s needed.
  1. Now defrag it.
  1. Once Completed, go back and select dismount it
  1. The Icon will go back to the original Look
  1. At this point I boot up my Maintenance device to make sure things are good
  1. Add you see its number 3.
  1. Once the machine boots up, you will see it in use in the “show vDisk Usage”
  1. Machine is up, log in and make sure it’s good.
  1. Now shut it down, and promote to PROD
  2. You will see the “show vDisk Usage” got to no devices
  1. Promote to Prod. Select Immediate or you can schedule it.
  1. It will now look like this
  1. Now copy the new Vdisk # 3 file to your other PVS servers to get this all green
  1. Copy from the Server you did the work on. In my case VS1PVS03


  1. Once the copy is completed, the replication will show green
  1. PVS Target check
  1. At this point I booted it up and it was golden.

This can be automated

Extra information


Total Breakdown of why it’s needed


Oct 212020


The Citrix WAN optimization policy (or “low bandwidth” policy) aims to compress and reduce the bandwidth used by the ICA protocol by lowering the visual quality for users with slow and unreliable connections. This article will benchmark the best possible configuration for the low bandwidth policy in a Citrix 7.15 LTSR CU3 environment.

Testing Protocol

In order to determine the most efficient WAN optimization policy in the Citrix environment (7.15 LTSR CU3), a benchmark tool will be used to execute a predefined set of actions for accurate data collection across the different tests run. The tool used for this documentation is PCMARK10 on Windows 2016. The test is composed with two specific configurations:

Web (Browsing + Multimedia): automated testing of HTML5 content rendered in a web browser, including video playback and rich media web browsing.

Office (Writing + Spreadsheets): automated testing of documents writing, with text typing simulation, images and text blocks pasting, pages scrolling, spreadsheets generation with large number of cells and graphics.

Web Browsing and Office tests are executed separately to measure the encoder performance in each context (multimedia or text).

Default configuration baseline

The ICA protocol configuration baseline for remote access by default is set to medium quality.

Specific settings excluded from configuration

Enable Extra Color Compression:
This setting will add extra picture compression at the expense of visually degraded quality. The measurements during the benchmark showed that this option added an interesting gain in term of bandwidth reduction, but the visual impact, especially on text, was not negligible. As you can see on the picture below, some text outputs are blurry and difficult to read.

The test is blurry beyond user acceptance when using Extra Color Compression

This option will be removed from the scope of the low bandwidth policy.

Target Minimum Frame Rate
The “Target minimum Frame Rate” setting is associated with the legacy mode (Adaptive Display or Progressive display configuration) but still referenced in 7.15 LTSR when using the compatibility mode. It is not clear how this setting is influencing the bandwidth compression when reaching low FPS and will not be included in the benchmark. The default value of 10 fps is used in all configurations.

Testing parameters

Different parameters are tested for a total number of six “Low Quality” tests (LQ1 to LQ6).

Test results

LQ5 is the most efficient configuration in this benchmark, with 65% gain in multimedia and web browsing testing and 47% gain in office and text testing, compared to the standard medium quality (MQ), and without noticeable compression artefacts and pixelisation. The use of selective H.264 encoding (LQ1 to LQ4) is slightly more efficient for web and multimedia activities, but will give less gain in office and text editing activities, and will add noticeable compression artefacts. For office and text editing, the “Compatibility mode” in LQ5, which use a traditional JPEG compression, is more stable (less artefacts) and more efficient for compression in this scenario. The 8-bit mode is interesting for office and text bandwidth compression but offers poor performances with web browsing and multimedia, and will substantially degrade the user experience in this mode.

WAN optimization user policy settings

The settings used in the policy are detailed below:

Desktop UI



Visual Display

Multimedia (redirection)

Low Bandwidth Policy Diagram