Microsoft Teams on Citrix XenApp

Teams is Microsoft’s new Skype and Slack-killer. But how well does it go on Citrix?

Introduction

Note – this article is now redundant. For updated information on Teams deployment on Citrix or other VDI/RDSH platforms, please see this series of articles.

Oh come sweet asteroid of death. Yes, that’s exactly how I feel after digging through the mess that is the guts of Microsoft Teams.

Teams is new. Teams is everywhere. Teams is going to put a bullet in the head of Skype for Business, eat Slack’s lunch, and be the face that launched a thousand Microsoft 365 subscriptions. But for those of us who manage XenApp and XenDesktop in non-persistent environments, Teams is a hideous glimpse of an application that Microsoft is so determined to dump onto every user that it possibly can, that it simply bypasses all the norms we’ve become used to, in the same way that Chrome and DropBox both can.

Installation of Teams

Firstly, when you download the Teams MSI (or, to give it the proper name, the “Teams Machine-Wide Installer”), you don’t actually install Teams when you run it. When you run this, it creates a folder in C:\Program Files (x86) called Teams Installer, and in there you will find two files only

This executable is auto-triggered at every user logon by an entry in the HKLM\Software\Wow643Node\Microsoft\Windows\CurrentVersion\Run area of the Registry which is also dropped by the Machine-Wide Installer

So when any user logs on to the machine, the executable from the c:\Program Files (x86)\Teams Installer folder runs, which triggers some more actions, namely:-

It spits out the Teams install into the user’s local profile, rather than anywhere in system areas

A desktop shortcut is written to the user’s profile (%USERPROFILE%\Desktop), with the target pointing to %LOCALAPPDATA%\Microsoft\Teams\Update.exe –processStart “Teams.exe”

A Start Menu shortcut is written to the user’s profile (%USERPROFILE%\Microsoft\Windows\Start Menu\Programs\Microsoft Corporation) which also points to %LOCALAPPDATA%\Microsoft\Teams\Update.exe –processStart “Teams.exe” as the target

It also drops an auto-start entry into the Registry, at HKCU\Software\Microsoft\Windows\CurrentVersion\Run, which points to the same executable as above with some slightly different parameters

The install (which is around 400MB to start with, and rapidly increases) will now follow the user because it is installed fully into the user profile. So if I log on to another XenApp server – even one without the “Machine-Wide Installer” installed, Teams is still available for use.

So when we install the Teams “Machine-Wide Installer” stub, we get a) an auto-launching app for every user that impacts performance as it installs into the user profile and then launches itself, and b) half a gigabyte of files dumped into our profile management tool for each instance of it, which will only grow bigger. Is there any way we can mitigate this impact?

Dealing with Teams

Once I’d investigated the app’s behaviour a bit more, I came up with a set of things I wanted to configure:-

  1. Stop the auto-launch at every user logon – drop the shortcuts, yes, but remove the subsequent auto-run
  2. Configure Teams so once the user had “installed” it (loosest possible use of the word), that it always opens up minimized. This is to ensure that when the user logs onto another session (such as from a meeting room kiosk or something) Teams doesn’t open up full-screen and expose any information
  3. If possible, reduce the size of the profile load and allow Citrix User Profile Management to roam it successfully
  4. Address any performance issues (not surprisingly, this is a complete resource hog)
  5. Get rid of the splash screen when the application launches

So, let’s see what we managed to do. All of this was done using Citrix Virtual Apps 1811 and Citrix UPM 1811 on Windows Server 2016, fully patched.

Stopping the auto-launch

Once you’ve installed the Machine-Wide Installer on your XenApp server or gold image, run this PowerShell afterwards

(Get-Content ${ENV:ProgramFiles(x86)}’\Teams Installer\setup.json’).replace(‘false’,’true’) | Set-Content ${ENV:PROGRAMFILES(x86)}’\Teams Installer\setup.json’

This will remove the flag in the JSON file that says “noAutoStart=false” with “noAutoStart=true”. This means when the user logs in, it will create the two shortcuts, dump the install files into their profile, but it won’t then run the app afterwards and ask for login/start a sync.

Also (not related but maybe good to mention), you need to make sure IE Enhanced Security Configuration is disabled on your targets, otherwise the Teams modern authentication will fail

Open minimized

Now, once the user logs into Teams using their Office365 account, they have the option to set it to run minimized within the application options. However, for my purposes, I always want it to run minimized to the notification area. Unfortunately, there are not yet Group Policy Objects, InTune ADMX files or even Registry values that control Teams behaviour. Annoying, but not unexpected, given the dumpster fire that is the rest of the product from an admin perspective.

What holds user settings is a JSON file in %APPDATA%\Microsoft\Teams called desktop-config.json. Rather than get gung-ho, the best option I could find was to edit the settings in this file at user logoff using a Group Policy logoff script (you could do it at logon as well, as long as it gets done at some point in the session then you’re good). A quick line of PowerShell will do the trick:-

(Get-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json).replace(‘”openAsHidden”:false’, ‘”openAsHidden”:true’) | Set-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json

Once this is done, a user logging in who already has the application “installed” will see it open minimized in the notification area, no matter what they configure in the GUI. Save the PowerShell as a .ps1 file and trigger it how you see fit (I chose a logoff script via GPO – pick your poison).

Reducing the bloat

Unfortunately this is a difficult matter, as everything that Teams needs to run – executables, libraries, modules, data – is all contained in the user profile. I managed to get UPM set so it only pulled about 200MB (!) instead of 400MB, but even so, that’s still awful.

Teams seems custom-designed for FSLogix, User Profile Disks, ProfileDisk or an Ivanti UWM VHD-Mount, and I’m wondering if the need to persist Teams data was a driving force in the FSLogix acquisition by Microsoft. Certainly, if you’re using one of these VHD solutions, then dealing with Teams data will be much less of a PITA.

It’s worth noting that the file called simply “RELEASES” in the Packages folder must be present otherwise the shortcut will not work (it just won’t launch the executable), which is why the exclusions below do not simply remove the Packages folder.

If you are using Citrix UPM or similar, this is the best I could do without breaking the application:-

Exclusion list – files

!ctx_localappdata!\Microsoft\Teams*.nupkg

Exclusion list – directories

!ctx_localappdata!\Microsoft\Teams\Current\Locales
!ctx_roamingappdata!\Microsoft Teams\Logs
!ctx_localappdata!\SquirrelTemp
!ctx_roamingappdata!\Microsoft\Teams\Application Cache
!ctx_roamingappdata!\Microsoft\Teams\Cache
!ctx_localappdata!\Microsoft\Teams\Packages\SquirrelTemp
!ctx_localappdata!\Microsoft\Teams\current\resources\locales

Default exclusion list – directories – ENABLED (this is required if you are using Teams with Google Chrome)

Files to synchronize – note the first two lines here, this excludes all locales from being captured except English. If you need other locales, configure the exclusions to suit your environment.

!ctx_localappdata!\Microsoft\Teams\Current\Locales\en*.pak
!ctx_localappdata!\Microsoft\Teams\current\resources\locales\locale-en*
!ctx_localappdata!\Microsoft\Teams\current\resources\locales\culture*

Also worth mentioning is that because this is (obviously) an Office 365 application, you need to roam the Office 365 licensing token correctly for the user’s logon details to persist. You can either capture this directly or use the GPO to redirect it to a different area and then grab it. There are a number of good articles on this already within the Citrix community.

Deal with performance issues

Teams is pretty atrocious performance-wise, once the user first logs in, it hammers the CPU pretty hard and will use a swathe of memory within its array of processes. From the point of view of the admin, there’s not a lot we can do without getting other tools involved. That’s why removing the “auto-install” flag is so handy, because it doesn’t start hammering the server until the user launches it for the first time. With “auto-install” on, a bunch of users logging on at the same time will bring the server to its knees. SO GET IT TURNED OFF!

Aside from that, there’s not much we can do, so using Workspace Environment Management or Ivanti Performance Manager or something similar might be a way to get it under control a bit. However – I haven’t tested doing anything like this. Once it is fully set up, it’s not as bad, but the initial launch and sync is definitely very stressful.

Remove the splash screen

I hate splash screens as a rule and like to get shot of them, waste of time and resources that they are.

Sadly this one appears to be here to stay. I can’t find any setting in any of the JSON files that seems to control the splash screen. If anyone finds out where it is, please let me know and I can update the article.

Summary

So if you want to use Microsoft Teams on XenApp or similar non-persistent:-

  • Install the Machine-Wide Installer
  • Turn off IE ESC for users
  • Run the PowerShell to edit the setup.json file after install
  • Configure a logon or logoff script to run it auto-hidden at logon using the PowerShell provided
  • If using UPM or similar, configure the inclusions and exclusions as listed
  • Ideally, use FSLogix or UPD or similar VHD tech to manage the profile
  • Make sure to roam the user’s Office 365 credentials
  • Pay attention to performance and address using tooling if necessary
  • Get used to the splash screen

There is another way, though – forget about the Teams application on XenApp and just use the web client until they fix the absolute mess of its behaviour and configuration. It might perform just as badly as the full-fat client, but you don’t have to drag 500MB+ around for every user. You have been warned!

Loading

123 comments

  1. For “Configure a logon or logoff script to run it auto-hidden at logon using the PowerShell provided” the user needs to launch Teams and click Sign in on the initial screen before you can modify that JSON attribute right? I have been looking for a way to have it bypass the first run login screen, do you by chance know if that is possible?

    1. Yes that’s right, the JSON file isn’t populated fully until the user signs in for the first time, unfortunately. However you could try auto-populating the JSON file yourself, I guess. Not sure if SSO to Teams is possible – people often have multiple accounts.

  2. Sounds like it might be a candidate for creating symbolic links to the read-only content like exes and dlls from the user’s profile to a single central install on c: although a standard user doesn’t have rights to create symbolic links by default so that would need considering.

    If I get some time, I’ll have a play – creating symbolic links is native to PowerShell 5.x via:

    New-Item -ItemType HardLink

  3. Been testing this with FSLogix, using the MSI (Teams Machine Installer)

    Using this MSI should allow auto trigger using the path below in the registry
    TeamsMachineInstaller Data=%ProgramFiles%\Teams Installer\Teams.exe –checkInstall –source=default”

    However, for us Teams will not self trigger, when using FSLogix as the VDH will creates the teams folder in appdata\local\microsoft and under roaming. If i remove the –checkinstall this will work. However this cant be left on as it will reinstall regardless whether you have a teams or now, as the check is bypass and with FSLogix i believe will increase the VDH.

    Have you tested MSI, with FSlogix (teams enabled via GPP)
    thanks

  4. On setup.json instead of .replace(‘false’,’true’) – which replaces all false -> true in the config, it’s safer to go more specific and only do a noAutoStart=false -> noAutoStart=true substitution.

    Cheers.

  5. Looking to do this ourselves in a few weeks, but as we are heavy Skype voice and video users we’ve delayed until the first drop of the hdx pack hits (still lacking the functions of sharing and remote control). I’m expecting a train wreck and having to sort out a mess similar to the one that we’ve been left with a wholesale onedrive fb migration and having to try and make that work in server 2016 without files on demand.

  6. Very nice article and most entertaining to read!

    In our test environment (XenApp 7.6CU6, Win2012R2) I am currently testing a Teams installation without actually installing Teams. I just copy the contents (Update.exe, app.ico, .\packages, .\current) into %programfiles(x86)% (32bit because otherwise the webcam via hdx won’t work), and publish .\current\Teams.exe. This seems to work and eliminates the whole profile bloating, since the app doesn’t copy itself into AppData.
    The fact that the auto-update is also broken this way is good and bad. We pubish updates on a regular basis but they have to be tested, so it’s good that the app won’t update itself but on the other hand, I don’t have any clue what unneccesary errors may be produced because of all this.
    Has anyone got any experience in such an installation or does anyone know how to properly turn off the AutoUpdate?

    Thanks in advance!

  7. Use the machine-wide installer with the no auto launch flag set to pre-populate the json and save the PowerShell step.

    Pull the HKLM Run key for the installer and replace with a marginally delayed logon script (start-sleep anyone? lol) that checks the Appdata path and installs or exists – use the same command line switches so it leverages the json, otherwise it will be all default.

    This will work fine with FSLogix. I’m not sure how much of the FSLogix thing is prepopulated paths as the same command line works with a slight delay introduced. This may be the installer kicks off and the destination path is then subsumed by FSLogix so it fails out.

    1. Have you got the no auto-launch flag handy Omar? I will update the post with it if it’s available.

      1. msiexec /i Teams_windows_x64.msi OPTIONS=”noAutoStart=true”

        Worth a test with your other flags, see if they appear in the deployment json too.

    2. And how many users do you have on one server? We are also using Teams on XenApp and FSLogix, on a HP Moonshot system. But Teams is a performance killer. As soon as I have more than 5 users on one server and all are running Teams, CPU is on 100% and the server is crasching sooner or later.

      1. I normally only have about ten users per server in the lab but they aren’t doing a lot, to be fair. In that instance I’d use WEM or Ivanti to bring it under control.

  8. Hello,

    i have the problem that in my Enviroment with VDA 1811 Teams could be installed and startet and used one time. The next time then i close Teams and start it again the Main Windows comes up blank. It dosn’t work anymore.

    Did someone have the same error?

    Kind Regards

    1. HI,

      the blank screen also happens on our side (VDA 1802, Server 2016), but only with the 64bit installer.

      regards

    2. I had the same issue with the second run of Teams. Blinking mouse cursor also appears. I copied the Teams folder to a central location on the XenApp server.

      My current work-around is deleting this file prior to starting Teams. With SSO configured users do not notice any issues.
      C:\Users\%username%\AppData\Roaming\Microsoft\Teams\settings.json

      1. Without wanting to break any NDAs, I think that a lot of the problems with Teams have been listened to, and we may well see some progress on these things in the future. Will update with an article as soon as anything that can be publicly announced comes along.

        1. Apparently the cat’s out of the bag. A per-machine Teams install is coming shortly according to the new out of Ignite.

          1. Yep, I’ve seen a preview and it looks good – *only* 90MB of rubbish in your profile instead of 500MB 🙂

      2. Excatly the same here. Thats so fu***ing anoying.

        First I’ve fighting with AppLocker and Teams. Than I figured out the issue with the flickering mouse with the 2nd start.

        It’s unbelivable that this software comes from Microsoft. I estimated that Microsoft has knowledge about Terminalservices and Application Programming.

    3. Yeah I have this Many times a week. My only work around is for the user to reinstall it. Kinda sucks. Teams is not Citrix or rdsh ready. The web version seems ok. But we don’t use video or calls. So I don’t know if the web would work for that.

    4. There is Workaround for this on (https://tech.xenit.se/teams-keeps-crashing-in-citrix/):

      “To get Teams to work on your Citrix environment if you experience this specific issue you need to exclude all Citrix Hooks from Teams.exe, you perform this by editing/adding the following registry value:

      32-bit version:
      HKLM\SOFTWARE\citrix\CtxHook\
      String Value: ExcludedImageNames
      Value: Teams.exe

      64-bit version:
      HKLM\SOFTWARE\WOW6432Node\citrix\CtxHook\
      String Value: ExcludedImageNames
      Value: Teams.exe

      Note: The server need to restart for the changes to take affect!”

    5. Hi,

      Is your issue is resolved? I am facing the same issue.. can you share the solution if you have.

      Thanks 😊
      Shahnawaj

  9. Would this help with Team.

    Large Profile handling – Files to be created as symbolic links

    AppData\Roaming\Microsoft\Teams\Application Cache\Cache\*.cache

  10. Office 365 ProPlus 1902 and newer builds now install Teams by default as well, but I noticed that the HKLM Run key that calls it is slightly different – “%ProgramFiles%\Teams Installer\Teams.exe –checkInstall –source=PROPLUS”. The actual files that get installed in the Teams Installer folder look the same. Any idea how changing the “source” from default to PROPLUS affects things? Does this mean the Teams app installed in this way might follow ProPlus’ update model and only update when ProPlus updates?

    1. Very good question, I hadn’t tried this. I’m assuming your initial feeling is correct, that it then fits in with the usual nuances of the ProPlus model.

  11. Hello,

    Thanks for this article !

    I think it’s a good idea to also exclude !ctx_localappdata!\Microsoft\Teams\current\previous fro Profile Management.

    Regards
    Julien

  12. Has anyone else seen while Teams is open in a session that you get a spinning wheel next to a mouse cursor?

  13. Did anyone get teams with ivanti EM VHD-redirect to work?
    We have Server 2016 XenApps (pvs) with the machine wide installer installed on it.
    When i configure the vhd mount and try to redirect %localappdata%\Microsoft\Teams to the vhd mount loaction, the teams installer deletes the symbolic links and recreates the folder again…

    So far our solution is to increase the cache size dramatically, so that we can handle 400mb per user in the write cache of provisioning …

  14. I just started testing the Teams per-machine installer in XD 7.15 LTSR today (W10 1709). Excluding ‘AppData\Roaming\Microsoft\Teams’ and sync’ing ‘AppData\Roaming\Microsoft\Teams\desktop-config.json’ in Citrix Profile Manager seems to keep the profile small and saves the user’s settings. I haven’t found any way to enable SSO for that first launch, though.

          1. That looks like the original installer with a tweak to allow installation to the “right” location maybe, not entirely sure

          2. Yes i can confirm that the new VDI bases installation is what we were looking for 🙂

            Make sure you install with the parameter ALLUSER=1 and the Teams client executable will be installed in C:\Program Files (x86)\Microsoft\Teams\current.

            Remove the following regkey to prevent autostart:

            REG DELETE HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run /v Teams /f

  15. Hello, does anywone know if it works in a non-persistent environment ( 7.15 ltsr MCS)
    and is it not supported or does it not work ?

    I know in the docs it says it is not supported but maybe it is not updated yet 🙂
    anyone tryed already ?

    1. it works for us. Xenapp 7.15 ltsr / PVS / AppLayering
      One thing i noticed is that the teams meeting addin is not showing in Outlook 2016.
      Any thoughts on that?

  16. well it also seems to work at our side. i do need to exclude C:\Users\%username%\AppData\Roaming\Microsoft\Teams\settings.json from roaming with the profile or else i ge the spinning wheel of death. after one succefull start.

  17. Teams VDI Installation. It seems to work for me. But also need to exclude files from C:\Users\%username%\AppData\Roaming\Microsoft\Teams\. if the user closes the program, it does not work before a new login / Clear off Appdata. Using Citrix 7.15 LTSR CU3 and CUPM. Any solution ?

  18. Would the recent change with Office 365, whereby Team is installed with ProPlus (unless excluded in the Config.xml), provide a similar experience to the above, or gets around some of this?

    Looking to install Teams with the O365 package on our MCS Master Image for non-persistent Win10 VMs

    1. Given Microsoft’s stance “we want it installed in the user profile so we can update it ANY TIME WE WANT and that’s great YAYYYYY!”, I’d expect it to be installed in the *rubbish* way described in the article.

  19. The VDI installer is fine, but the “open application in background” option doesn’t work in a non-persistent Citrix XenDesktop VDI.

  20. Hi James
    I have the VDI version installed on latest version Citrix 1906 using an FSLogix profile container along with WEM doing everything else. Currently it’s in a lab environment. Teams works but is not remembering the users login. So when user first logs in they then have to login to teams. Is this normal, is there any way to remember the login?

      1. Yes I think so, users are not asked to reactivate and I installed with shared computer licensing key. Is that what you mean?

        1. https://docs.microsoft.com/en-us/deployoffice/overview-of-shared-computer-activation-for-office-365-proplus

          Single sign-on recommended
          The use of single sign-on (SSO) is recommended to reduce how often users are prompted to sign in for activation. With single sign-on configured, Office is activated using the user credentials that the user provides to sign in to Windows, as long as the user has been assigned a license for Office 365 ProPlus. For more information, see Understanding Office 365 identity and Azure Active Directory.
          If you don’t use single sign-on, you should consider using roaming profiles and include the %localappdata%\Microsoft\Office\16.0\Licensing folder as part of the roaming profile.

          Licensing token roaming
          Starting with Version 1704 of Office 365 ProPlus, you can configure the licensing token to roam with the user’s profile or be located on a shared folder on the network. Previously, the licensing token was always saved to a specific folder on the local computer and was associated with that specific computer. In those cases, if the user signed in to a different computer, the user would be prompted to activate Office on that computer in order to get a new licensing token. The ability to roam the licensing token is especially helpful for non-persistent VDI scenarios.

          To configure licensing token roaming, you can use either the Office Deployment Tool or Group Policy, or you can use Registry Editor to edit the registry. Whichever method you choose, you need to provide a folder location that is unique to the user. The folder location can either be part of the user’s roaming profile or a shared folder on the network. Office needs to be able to write to that folder location. If you’re using a shared folder on the network, be aware that network latency problems can adversely impact the time it takes to open Office.

          If you’re using Group Policy, download the most current Administrative Template files (ADMX/ADML) for Office and enable the “Specify the location to save the licensing token used by shared computer activation” policy setting. This policy setting is found under Computer Configuration\Policies\Administrative Templates\Microsoft Office 2016 (Machine)\Licensing Settings.

          If you’re using the Office Deployment Tool, include the SCLCacheOverride and SCLCacheOverrideDirectory in the Property element of your configuration.xml file. For more information, see Configuration options for the Office Deployment Tool.

          To edit the registry, go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration, add a string value of SCLCacheOverride, and set the value to 1. Also, add a string value of SCLCacheOverrideDirectory and set the value to the path of the folder to save the licensing token.

          Note

          If you’re using Microsoft Application Virtualization (App-V) to deploy Office 365 ProPlus, the registry location is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\16.0\Common\Licensing.

        2. Odd that it would then ask for Teams logins constantly, it is logging in through SSO in my environment.

          1. Hi Guys, thanks for all the info, much appreciated, I used the deployment tool and SCLCacheOverride on my current gold image. Although when I tested the other day that was on a different image and I am not 100% sure I used the right script. (loooong week). I will try it out again on the current version, but I should really have asked what version do you guys recommending using on a full FSLogix profile container in a non-persistent environment. I noticed MS saying the vdi version is not for non-persistent environments, but if reading you guys correct, you got this working. If I am using FSLogix, does it even matter?

  21. Thank you, very good information. Would add the information that the 64-Bit installer is not working: The 64-Bit installer creates a wrong “run” registry key that points to “c:\program files\…”, but teams.exe is located in “c:\program files(x86)” also with the 64-Bit installer. The 32-Bit installer creates the registry key with the correct path, but without the parameters that are mentioned in this article.

    But it’s working different in our environment: After the user starts the teams client the first time, teams also creates a folder in c:\programdata\ which contains around 270 MB of data. Is there any possibility to prevent that?

  22. I was able to eliminate 1 login and skip directly to organisation Sign-in page by persisting / retaining desktop-config.json file under Roaming Profile path AppData\Roaming\Microsoft\Teams\desktop-config.json

    Before Including this file in the UPM Files to Sync path we had 2 step login
    1. Teams will show Login page (Enter your Work, School and Microsoft Account) with Sign InTab
    2. After Entering the Account Info, It takes us to Organization Sign-In page

    By Retaining the file (desktop-config.json) in UPM for Non-Persistent VDAs, we are eliminating Step 1 and it takes us directly to Step 2

  23. Hi, does FSLogix 2.9.6999.2588 Office containers support the ALLUSER=1 switch as the log shows it can’t detect Teams. Wondering if the install should be the default without the ALLUSER switch and let Teams write into AppData where FSLogix will capture it?

  24. For users in Windows 2016 the redirection of the Teams folders will not work\happen if the Teams folder not already exist on the users profile (local appdata).
    The ODFC log says: “Teams installation was not found” This puts us in a “difficult loop”.

    In 2012r2 the Teams folder are redirected anyway, and we use a .ps1 script to install the client first time the users logs on.

    Any tips or experiences with the same issue?

  25. Correction. Thus has nothing to do win Win 2012 vs 2016.

    The problem is upgradding the fslogix client from 2.9.6964.52690 to the “Microsoft version” 2.9.7117.27413

  26. Is anyone experiencing AppData\Local\Microsoft\Teams directory being left behind with UPM attempting to remove it? I’m using O365 Version 1902 11328.20438 + FSLogix on Server 2016 and VDA 1909. Teams data is included in the O365 container. The client functionality seems to work okay.

  27. how can i completely remove teams from User profile, for UPM profile. Cleaning up master Image and deploying to VDAs is not helping it. Is there any ways to remove for all users.

    1. Yeah, don’t let them install it? Either block it from executing with something like AppLocker or block the Teams URLs? Or am I missing the point here?

  28. Thought of sharing this. might be helpful to others.
    I had tough time getting Teams working in Win2016 RDSH Citrix VDA 7.15 LTSR with Appsense Personalization in place. Latest MSI version (Nov 2019 release) fixes Timeout issue, but App was crashing every 26 mins and it will auto login. We decided not to personalize Teams, so didnt think of adding in Office App Group in Appsense personalization. Believe what, Teams will still try to read/write other Office Apps virtual directory. Adding Teams.exe to Office App Group and excluding Teams folders from personalization capture resolved our issue. We are keeping it very simple. Auto Launch is disabled by deleting Teams from RUN key and No personalization.

    Note: Teams MSI Oct 2019 release has Auto SignIn issue

    1. Is anyone else still having issues disabling auto-launch? I’ve tried literally every suggestion I can find and Teams still launches at login. Using the latest Jan 2020 .MSI, Win10 Citrix VDA 7.15 LTSR.

      1. Same, there is no way to stop teams from autolaunching. I have tried every way to edit the JSON file and every trick. So far teams ignores everything. If you find anything please reply.

        1. Try this
          Create a machine GPO to delete the following key
          HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run
          Delete the value Teams

          This will prevent Teams to autostart when a user logon.

  29. How about Auto Update.
    The issue we are running into is that the end user has the ability to Update. Once this happens they lose the ability to Screen Share

  30. The logoff script that sets the openAsHidden does not work. Try doing it in a powershell prompt, it doesn’t find what it’s supposed to replace.

  31. I find what’s wrong with the powershell that changes the openAsHidden to true. This website’s font makes it not work. You have to change the single and double quotes manually to the normal font or it won’t work.

  32. Aha, even after I got the .json file updating correctly at logoff/logon, I found that when you install it with the switch ALLUSER=1, Teams doesn’t honor that json file per https://www.reddit.com/r/Citrix/comments/cj49q1/ms_teams_setting_wont_persist/

    However, you can stop the auto launch by removing its entry from Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run and you can even cause it to start minimized by leaving the entry there and adding switches to the end!!!

    “C:\Program Files (x86)\Microsoft\Teams\current\Teams.exe” –process-start-args “–system-initiated”

    You can set that (auto hide) with this .reg file:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run]
    “Teams”=”\”C:\\Program Files (x86)\\Microsoft\\Teams\\current\\Teams.exe\” –process-start-args \”–system-initiated\””

    1. How in earth did you find this out? So many hours of searching and was no where near this.

      What does process start argument system imitated even mean?

      thanks

    2. Also, Have you tried to run this is a command prompt to test?

      Im getting a few errors that dont seem very healthy.

      (node:11304) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 appInitialized listeners added. Use emitter.setMaxListeners() to increase limit

    3. To add to Ferrels info:

      In my RDSH non-pers environment with Teams installed with ALLUSER=1, I wanted to have ONLY members of the Teams AD group have Teams run Minimized on logon. To do so, I exported the Teams value and removed from:

      HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run

      and replaced it within:

      HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

      I appended –process-start-args “–system-initiated” to the end of the command BUT….. It still didn’t run minimized.

      Here is the kicker!

      The argument added to the Run won’t work on its own. It needs to also have either the end user tick the “Open application in background” option within Teams or have the Desktop-config.JSON file modified as per James’ instructions above.

      (Get-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json).replace(‘”openAsHidden”:false’, ‘”openAsHidden”:true’) | Set-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json

      This way, you can append Teams to your gold image, strip out shortcuts etc, and set up a GPO, EM or WEM trigger to replace shortcuts and run the Teams commnd with the arguments any way you see fit.

      Cheers

  33. The reg switches provided by Ferrel Noon worked for me to get TEAMS to start minimized. But I had to change the double dashes and quotes manually to the normal font to get it to work:

    “C:\Program Files (x86)\Microsoft\Teams\current\Teams.exe” –process-start-args “–system-initiated”

    Much appreciated!

  34. Thanks for al the input, it has helped in helping solve the Teams mystery.

    Has any of you considered how to turn off Teams when a user click the X and close last application? Will Teams not keep on running?

  35. Hi, nice article and conversation..
    I have an issue. When a user logs off the below file is still hanging in there.. and I am even using UPM and delete roaming cache… Only this file stays… And it is impossible to delete it..
    %AppData%\Roaming\Microsoft\Teams\skylib\slimcore-aria-cache.data-shm
    anyone got the same issue?
    I have the same issue with locallow\sun
    that folder is also impossible to delete..
    To get rid of those files and folders… a server reboot is needed..
    And this is for users that are logged out and don´t have any processes running..
    Cheers

    1. Hi Lars, I haven’t seen this issue but I would recommend using Process Explorer to find out which process is keeping the file open (use the Find Handle or DLL function and search for a string such as “slimcore”). Good chance that may help you identify the PID that has the file open and maybe restart a service or something to alleviate it? Sounds like buggy behaviour to be fair.

  36. Just wanted to share the steps needed to get Teams working as a published app in Citrix – 7.15 LTSR

    Installed Teams msi file: msiexec /i “Teams_windows_x64.msi” /l*v Install.Log ALLUSER=1 ALLUSERS=1
    Published: cmd.exe
    Commandline argument: /c del “%APPDATA%\Microsoft\Teams\settings.json” | “C:\Program Files (x86)\Microsoft\Teams\Update.exe” –processStart “Teams.exe” –process-start-args “–system-initiated”

    Created logoff script:
    (Get-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json).replace(‘”runningOnClose”:true’,'”runningOnClose”:false’) | Set-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json

    (Get-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json).replace(‘”disableGpu”:false’,'”disableGpu”:true’) | Set-Content $ENV:APPDATA\Microsoft\Teams\desktop-config.json

  37. Hi guys

    We have Teams installed on our non-pers RDSH 2016 Servers with XD1912 and we see an enormous memory usage just by Teams. At least 512MB RAM just for all the Teams instances per User. We have luck that most of the users are still using Skype, so they arent starting Teams normally.

    Do you guys also have this problem? Or is there a solution to lower the memory usage of Teams?

    Cheers

    1. Only real solution is use the offloading in Citrix. And that requires fairly decent clients and potentially a newer version of CVAD. However with offloading for *most* users, we see no impact on performance from audio or video.

  38. Hi James,
    I hope you are doing well. Apologies, I meant to post this here but posted it on your discussion regarding profile containers….I’m posting here for relevance, please feel free to remove it from that thread.
    I’m taking a chance you can help. I have configured FSLogix Office 365 Containers in conjunction with Citrix UPM. Almost everything is working (after much tweaking and testing) and I have included Outlook and Teams into the solution to assist with limiting Profile Bloat in the UPM profile. Teams is writing the 326MB back to the .VHDX file and the profile is not growing anymore. I close the first session where I set up Teams and Outlook, and log off to see the 0 Bytes Teams folder in the UPM\Local\AppData\Microsoft path in the profile, all great so far. I log back in, data pulls from the .VHDX file no problem and the Teams data is populated into the local profile on the VDA. I launch Outlook and the pre-configured user settings are there, mail opens without the need to re-enter all the user details. But Teams seems to have an issue opening. As mentioned all the files appear to be in the local AppData location as required, Teams does start on the machine because it is running in the system tray and you can click on Get Logs/Settings/Open and Quit. If you click open, Teams launches, but minimised and it looks like a blank window when you hover over the Teams icon in the taskbar. I cannot open Teams, maximise or anything with it…. I have checked Windows Application logs in Event Viewer….can’t seem to find any errors there, I also checked the logs in the system tray for Teams and can’t find anything telling there either. Nothing jumps out at me in the frxtray logs either and I’m a bit stumped as to what the issue may be. It’s the last hurdle in completing the move of Teams and Outlook from UPM to FSLogix Office containers, and I’m really a bit stumped now. I can’t even find anything in discussion forums anywhere where most issues are of the ‘white screen variety’ rather than this little gem I’ve managed to generate. ? Do you have any thoughts or ideas? Thank you in advance. Steve

  39. Hi James

    Thanks for this article, has helped me implement Teams in Citrix.

    However, I’m faced with an issue where Teams still auto-launches even though the noAutoStart flag is set to true in the settings.json (C:\Program Files (x86)\Teams Installer) and openAtLogin is set to false, openAsHidden is set to true in the desktop-config.json (redirected user profile folder).

    Any ideas please?

  40. Hello sir, i there a way to get rid of the teams is ready enjoy notification? I get this notifcation everytime i login and teams starts.

    1. Not sure about that one, I’m assuming it is a Registry value? Have you got an example of it (you can email to james [at] james-rankin [dot] com

  41. Hey James

    Enjoyed the article and held off with MS Teams deployment until it had been around a while and the Citrix Optmisation was deployed. Have it running on a Test server (Windows 2K12R2, with Office 2016 and Teams (32 Bit) and WEM (enabled for System Optimisation) randomly user report the desktop is laggy and when conencting I can see a couple of Teams Users hammering CPU Resources via some of the million Teams.exe processes. When I speak to teh users they aren’t actually doing anything in Teams but when I terminate teh CPU Hog performance for other users is reported as back to normal. Just wondered if you’d seen anything similar running 1.3.00.13565 version of teams but saw the same issue in an earlier version

    1. Not seen that, but I have heard tell of users needing to disable GPU acceleration on non-GPU workloads to get around some performance issues. This PS would disable it – (Get-Content ${ENV:APPDATA}’\Microsoft\Teams\desktop-config.json’).replace(‘disableGpu”:false’,’disableGpu”:true’) | Set-Content ${ENV:APPDATA}’\Microsoft\Teams\desktop-config.json’

  42. Hello all. Appreciate this is an old post but we are looking to deploy teams in our xenapp 7.15 environment with PVS. Is Teams officially compatible in PVS and is the Teams optimisation pack compatible in PVS. We will also be using FXlogic for Teams only profile management.

    Thanks

  43. We’re about to begin using Teams in our non-pers environment. Using FS o365 containers / Appsense.

    Noticed we get prompted for Teams password at every logon (not prompted for email…).

    Any ideas? I thought Teams uses Cred mgr, to which we capture with Appsense EM. Everything else *seems* to be persisted OK.

    Thanks,

    M

    1. If you capture the Office Licensing details into office365 Container using the Registry value, and turn off AppSense, do you still see the same behaviour?

      1. Thanks James,

        The Office activation / licensing setting captured the credentials and all is working sweet.

        Fleeting Question if I may? Do “Redirection.xml” also apply to o365 containers? I’m assuming not. Noticed since switching on licensing that I got a 5GB fresh VHDS (up from 400mb in previous tests). Ive shrank the VHDX down again with Jim Moyles script, however I ‘d like to avoid the bloat.

        Cheers again

      2. We have a similar issue to this but we are using just Appsense. We have the teams.exe in the Office application group and then the VHD redirection from Appsense for Teams.
        The first login is ok as it creates the VHD.
        The second time a user logs on they get asked for a login for MS Teams. Once they enter this it is remembered.
        This didn’t happen before we added the VDisk and teams.exe to the Office application group
        Is it possible to avoid this?

        1. Not sure what the best practice for Teams is with Ivanti. Does the VHD redirection get captured as part of the Office group?

          BTW – do you work for Guinness Northern Counties?

          1. Its basically redirecting %APPDATA%\Microsoft\Teams to a VDisk. I have cleared Appsense personalization and this isn’t having an affect. It seems to be when we roam to a VDisk after the second login it wants the user to confirm the username & password. This doesn’t happen if we don’t roam to a vdisk…

            Drop me a private message or email about Work 🙂

          2. Sounds like something isn’t getting caught in the VHD file. Maybe the AppSense filter driver is intercepting it for Personalization? Does it still happen if you disable Personalization?

            I did some contract work at GNC back in the day, that’s the only reason I was wondering.

          3. I have disabled personalization and tried capturing the below two paths on the vdisk but still get the login prompt on second login

            C:\Users\username\AppData\Local\Microsoft\IdentityCache (%localAppdata%\Microsoft\IdentityCache)

            C:\Users\username\AppData\Roaming\Microsoft\Teams (%appdata%\Microsoft\Teams)

            Tempted to try FXLogix and see if that works..

            I have raised a support ticket with Ivanti.

  44. We use Teams with RDS (multi user) on Citrix with PVS. We use Ivanti for profile / saving Teams settings. We already increased the vdisk to 25 GB. We have 10-15 users on this server. Now after some hours vdisk is getting full again and server crashed. What does Teams to the vdisk and how can i solve this?

      1. This are my exclusions in Ivanti:

        %APPDATA%\Microsoft\Teams\*.txt
        %APPDATA%\Microsoft\Teams\Packages\SquirrelTemp
        %APPDATA%\Microsoft\Teams\Service Worker\CacheStorage
        %APPDATA%\Microsoft\Teams\Application Cache
        %APPDATA%\Microsoft\Teams\Cache
        %APPDATA%\Microsoft\Teams\Media-Stack
        %APPDATA%\Microsoft\Teams\Logs
        %APPDATA%\Microsoft\Teams\GPUCache
        %APPDATA%\Microsoft\Teams\meeting-addin\Cache

      2. I have seen some people denying NTFS permissions per user on %APPDATA%\Microsoft\Teams\Service Worker\CacheStorage. Do you know how i can automate this with Ivanti for instance?

          1. I now use this script when launching Teams and it works just fine. No more issues on Citrix.

            $CacheStorage = ($env:APPDATA + ‘\Microsoft\Teams\Service Worker\CacheStorage’)

            If (Test-Path -Path $CacheStorage) {
            # If deny rights are already set on CacheStorage, exit script
            $ACL = Get-Acl -Path $CacheStorage
            If ($ACL.access.where({ $_.AccessControlType -eq ‘Deny’ })) { exit }

            # We delete files first to prevent the Remove-Item -recurse bug in Powershell 5
            $SubItems = Get-ChildItem -Path $CacheStorage -File -Recurse -Name
            foreach ($Item in $SubItems) {
            $null = Remove-Item -Path ($CacheStorage + ‘\’ + $Item) -force
            }

            # We delete the remainder folders including CacheStorage
            $null = Remove-Item -Path $CacheStorage -force -Recurse
            }

            # Create parent folders if Teams/VDI was never opened yet
            $Microsoft = ($env:APPDATA + ‘\Microsoft’)
            If (!(Test-Path -Path $Microsoft)) {
            $null = New-Item -Path $Microsoft -ItemType ‘Directory’
            }

            $Teams = ($env:APPDATA + ‘\Microsoft\Teams’)
            If (!(Test-Path -Path $Teams)) {
            $null = New-Item -Path $Teams -ItemType ‘Directory’
            }

            $ServiceWorker = ($env:APPDATA + ‘\Microsoft\Teams\Service Worker’)
            If (!(Test-Path -Path $ServiceWorker)) {
            $null = New-Item -Path $ServiceWorker -ItemType ‘Directory’
            }

            # Create CacheStorage folder
            $null = New-Item -Path $CacheStorage -ItemType ‘Directory’

            # Set Deny permission on CacheStorage to currently logged on user
            $ACL = Get-Acl -Path $CacheStorage
            $Username = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
            $DenyRule = New-Object System.Security.AccessControl.FileSystemAccessRule($Username, “Write”, “Deny”)
            $ACL.SetAccessRule($DenyRule)
            $ACL | Set-Acl -Path $CacheStorage

  45. How can i start Machine wide installer minimized for all users? i tried multiple comment in here but looks like that is outdated.

  46. how are you lot running the log off ps1? I can’t get it to actually run and make the change to the users json

      1. hmm. I get this output if I run manually. Will try work out what might not have copy-pasted correctly from this site

        PS C:\> .\teamsminimised.ps1
        At C:\teamsminimised.ps1:1 char:72
        + … nt $ENV:APPDATA\Microsoft\Teams\desktop-config.json).replace(‘”op …
        + ~
        Missing ‘)’ in method call.
        At C:\teamsminimised.ps1:1 char:72
        + … s\desktop-config.json).replace(‘”openAsHidden”:false’, ‘” …
        + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Unexpected token ‘‘”openAsHidden”:false’’ in expression or statement.
        At C:\teamsminimised.ps1:1 char:102
        + … \desktop-config.json).replace(‘”openAsHidden”:false’, ‘”o …
        + ~
        Missing argument in parameter list.
        At C:\teamsminimised.ps1:1 char:133
        + … €˜â€openAsHidden”:false’, ‘”openAsHidden”:true’) | Set-C …
        + ~
        Unexpected token ‘)’ in expression or statement.
        At C:\teamsminimised.ps1:1 char:135
        + … ”openAsHidden”:false’, ‘”openAsHidden”:true’) | Set-Con …
        + ~
        An empty pipe element is not allowed.
        + CategoryInfo : ParserError: (:) [], ParseException
        + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall

  47. Hi James,

    Have you ever had the chance running Teams with MFA enabled, and mfa token being saved/reused when reopening a new Citrix session, so credentials are skipped?

    Thanks,

    1. I do run Teams with MFA, and I only ever need to provide the MFA at first logon, so I thought this was by design….

      1. So if you have 5 VDA’s, CITRIX1, CITRIX2, etc… and they are re-built non-persistent (Windows 2016 Server let’s say) with MCS every night, the 2FA always kicks in on next day/logon. Annoying.

        Unless you have the O365 E3 + P1 license and setup the trusted IP’s, will always be an issue.

        1. Er no, you simply need to persist the profile using a profile management tool, and you will be fine.

  48. Hi, in the middle of all these experts, I have a question about using Teams on XenApp.
    When making a Teams call transfer WITH CONSULT, I cannot consult a mobile phone number or PSTN external number. This can be done with a local Teams client though. Does anyone have an idea or experience the same problem ?

    Thanks for replying!.

    Lucien Roelofs

  49. Hi James,

    I hope you could help me figuring out the issue on my Microsoft Teams Addin for outlook 2013/2016. The addin is missing in the calendar tab but if you check on Outlook/Options/Addins the Teams is there. If i open the outlook with this switches outlook.exe /resetnavpane the MS Teams plugin in the calendar show up. after logout it goes back again.

    VDA 1912 LTSR CU3
    WEM 2109.1.0.1
    Windows Server 2016
    Using UPM

    Thanks

    Raymond

  50. Hi James,

    Thank you for your prompt response. What i did is i stop all the Citrix Services and login to my VDA using the user with issue. The User login as local user and i was able to see the Microsoft teams Addin in the Calendar. This is UPM issue then? i am using WEM for my UPM administrations.

    Thanks

    Raymond

    1. Certainly sounds like a UPM issue. Try removing any Teams exclusions you may have configured in UPM and then re-enabling the UPM feature?

  51. Thanks James! yes its UPM. i removed my UPM control in WEM and put it back to GPO now its working.

    Appreciate all your help!

  52. Great article!
    I heard a whisper early last year that to avail of the offloading capabilities, the Teams version had to be 32bit. A customer I worked with last summer had the 32 bit Teams in their XenApp environment and I vaguely remember when checking inside a session, the version from About it would show “Citrix HDX Optimised” meaning offloading was working.
    Is this still true?

    1. I’ve never heard this, but I also have never heard of the Teams installer being available as x86 and x64, so I am somewhat confused. As far as I am aware, the Teams installer only goes into x86 Program Files, so I am not aware that there is an x64 installer for it?

Leave a Reply to rab Cancel reply

Your email address will not be published. Required fields are marked *