Microsoft Teams – Fix “Sorry, we couldn’t connect you.” for multiple users’ profiles
In this blog I will share one way to fix Microsoft Teams “Sorry, we couldn’t connect you.” for multiple users’ profiles and in multiple workstations or virtual machines.
Introduction
Multiple users reported receiving “Sorry, we couldn’t connect you.” when they tried to join a meeting using Microsoft Teams.
Environment
Users are using Azure Virtual Desktop Microsoft Windows 10 multi-session. Multiple users are able to log on the VM at the same time. There are more than 20 VMs with more than 12 profiles per VM.
Issue Resolution
To resolve the issue for my account, I cleared the Teams cache using instructions in Clear the Teams client cache.
- If Teams is still running, right-click the Teams icon in the taskbar, and then select Quit.
- Open the Run dialog box by pressing the Windows logo key +R.
- In the Run dialog box, enter %appdata%\Microsoft\Teams, and then select OK.
- Delete all files and folders in the %appdata%\Microsoft\Teams directory.
- Restart Teams.
Clear Teams Cache in Multiple Profiles
We will follow the below steps to clear Teams cache from existing profiles on a single VM. To run the script, log on to the VM with an administrative account, use Enter-PSSession, or any other Microsoft supported command.
- Query C:\Users folder for existing users’ profiles.
- For each profile, delete all files and folders in the C:\Users\profile_name\AppData\Roaming\Microsoft\Teams directory.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$Wksts = "vdi-east-0" $Users = Get-ChildItem -Path "\\$Wkst\c$\Users" -Directory -ErrorAction SilentlyContinue | Select-Object FullName ForEach ($User in $Users) { $TeamsCache = $User.FullName + "\AppData\Roaming\Microsoft\Teams" If (Test-Path $TeamsCache) { Write-Host ("`tDeleting [$TeamsCache]") Remove-Item "$TeamsCache\*" -Recurse -Force } Else { Write-Host ("`tFolder does not exist [$TeamsCache].") } } |
Clear Teams Cache in Multiple Profiles in Multiple VMs or Workstations
We will run the above script for each VM/workstation. I ran the below script on a workstation that has access to all workstations listed in $Wksts and logged on with an account that has administrative privilege on all workstations listed in $Wksts.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
$Wksts = "vdi-east-0,vdi-east-1,vdi-east-2,vdi-east-4".Split(",") Write-Host ("") ForEach ($Wkst in $Wksts) { Write-Host ("*** $Wkst") $Users = Get-ChildItem -Path "\\$Wkst\c$\Users" -Directory -ErrorAction SilentlyContinue | Select-Object FullName ForEach ($User in $Users) { $TeamsCache = $User.FullName + "\AppData\Roaming\Microsoft\Teams" If (Test-Path $TeamsCache) { Write-Host ("`tDeleting [$TeamsCache]") Remove-Item "$TeamsCache\*" -Recurse -Force } Else { Write-Host ("`tFolder does not exist [$TeamsCache].") } } } |
Conclusion
Did you find this blog easy to follow and helpful to you? Let me know in the comments below.
Disclaimer
Purpose of the code contained in blog is solely for learning and demo purposes. Author will not be held responsible for any failure or damages caused due to any other usage.
There's no comments