SOLVED: Microsoft Teams "Cannot install for all users when a VDI environment is not detected"
How to fix error when installing Microsoft Teams "Cannot install for all users when a VDI environment is not detected"
Teams.exe Installation has failed
Cannot install for all users when a VDI environment is not detected
Installing Teams per-machine
In Virtual Desktop environments, Teams should be installed per-machine rather than per user. The per-machine installation puts the Teams executable into "C:\Program Files (x86)\Microsoft\Teams" instead of the user's AppData profile folder "C:\Users\UserName\AppData\Local\Microsoft\Teams"
Use the ALLUSER=1 option to install Teams per-machine
msiexec /i Teams_windows_x64.msi ALLUSER=1 ALLUSERS=1 /qn
ALLUSER=1
Install Teams per-machine in a VDI environment; updates are disabled.
ALLUSERS=1
Install Teams for all users. Teams shows in the list of installed programs in the Control panel and can be uninstalled with Admin credentials.
Cannot install for all users when a VDI environment is not detected
If you get the error "Cannot install for all users when a VDI environment is not detected" when installing Teams using the ALLUSER=1 option for per-machine installation, it's because Teams checks for VDI environment by looking for one of these registry keys.
HKLM\Software\Microsoft\Teams\IsWVDEnvironment
HKLM\Software\Citrix\PortICA
HKLM\Software\VMware,Inc.\VMware VDM\Agent
Create WVDEnvironment registry key using PowerShell
The solution is to create one of the VDI registry keys using PowerShell.
# create registry key and value for WVDEnvironment New-Item -Path "HKLM:\SOFTWARE\Microsoft" -Name "Teams" -Force New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Teams" -Name "IsWVDEnvironment" -Value 1 -Force
Comments