Microsoft Teams cache behaviour is a lot to be desired if I am honest. One thing for sure is that if you are deploying Teams you’ll quickly find that your admin controlled policy settings take a random amount of time to come into effect on the target machines.
Unlike Skype for Business Online where in-band policy changes took longest 30 minutes, with Teams we can be waiting days, and I mean that literally.
Upon talking with support the standard response is that it can take anything from 30 minutes to 3 days for policies to become effective. To me, this is unacceptable and Microsoft have acknowledged that at least. Hopefully we will see some improvements soon.
The problem though really centers around the client cache. So clearing the cache is the first step to troubleshooting. The trouble is, the cache for Teams isn’t in one place or even a single directory. It’s split in multiple directories and even Internet Explorer and Chrome cache locations. So when support as you to clear the cache, there are something like 13 different places you need to go in order to clean the machine.
These locations are:
- %AppData%\Microsoft\teams\application cache\cache
- %AppData%\Microsoft\teams\blob_storage
- %AppData%\Microsoft\teams\databases
- %AppData%\Microsoft\teams\cache
- %AppData%\Microsoft\teams\gpucache
- %AppData%\Microsoft\teams\Indexeddb
- %AppData%\Microsoft\teams\Local Storage
- %AppData%\Microsoft\teams\tmp
- %LocalAppData%\Google\Chrome\User Data\Default\Cache
- %LocalAppData%\Google\Chrome\User Data\Default\Cookies
- %LocalAppData%\Google\Chrome\User Data\Default\Web Data
- Internet Explorer Temporary Internet Files
- Internet Explorer Cookies
Only after clearing these locations is it considered a clean start for the Teams app. Through pain of trial I have now given up and made a PowerShell script to do this for me, shared below.
$challenge = Read-Host "Are you sure you want to delete Teams Cache (Y/N)?" $challenge = $challenge.ToUpper() if ($challenge -eq "N"){ Stop-Process -Id $PID }elseif ($challenge -eq "Y"){ Write-Host "Stopping Teams Process" -ForegroundColor Yellow try{ Get-Process -ProcessName Teams | Stop-Process -Force Start-Sleep -Seconds 3 Write-Host "Teams Process Sucessfully Stopped" -ForegroundColor Green }catch{ echo $_ } Write-Host "Clearing Teams Disk Cache" -ForegroundColor Yellow try{ Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\application cache\cache" | Remove-Item -Confirm:$false Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\blob_storage" | Remove-Item -Confirm:$false Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\databases" | Remove-Item -Confirm:$false Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\cache" | Remove-Item -Confirm:$false Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\gpucache" | Remove-Item -Confirm:$false Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\Indexeddb" | Remove-Item -Confirm:$false Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\Local Storage" | Remove-Item -Confirm:$false Get-ChildItem -Path $env:APPDATA\"Microsoft\teams\tmp" | Remove-Item -Confirm:$false Write-Host "Teams Disk Cache Cleaned" -ForegroundColor Green }catch{ echo $_ } Write-Host "Stopping Chrome Process" -ForegroundColor Yellow try{ Get-Process -ProcessName Chrome| Stop-Process -Force Start-Sleep -Seconds 3 Write-Host "Chrome Process Sucessfully Stopped" -ForegroundColor Green }catch{ echo $_ } Write-Host "Clearing Chrome Cache" -ForegroundColor Yellow try{ Get-ChildItem -Path $env:LOCALAPPDATA"\Google\Chrome\User Data\Default\Cache" | Remove-Item -Confirm:$false Get-ChildItem -Path $env:LOCALAPPDATA"\Google\Chrome\User Data\Default\Cookies" -File | Remove-Item -Confirm:$false Get-ChildItem -Path $env:LOCALAPPDATA"\Google\Chrome\User Data\Default\Web Data" -File | Remove-Item -Confirm:$false Write-Host "Chrome Cleaned" -ForegroundColor Green }catch{ echo $_ } Write-Host "Stopping IE Process" -ForegroundColor Yellow try{ Get-Process -ProcessName MicrosoftEdge | Stop-Process -Force Get-Process -ProcessName IExplore | Stop-Process -Force Write-Host "Internet Explorer and Edge Processes Sucessfully Stopped" -ForegroundColor Green }catch{ echo $_ } Write-Host "Clearing IE Cache" -ForegroundColor Yellow try{ RunDll32.exe InetCpl.cpl, ClearMyTracksByProcess 8 RunDll32.exe InetCpl.cpl, ClearMyTracksByProcess 2 Write-Host "IE and Edge Cleaned" -ForegroundColor Green }catch{ echo $_ } Write-Host "Cleanup Complete... Launching Teams" -ForegroundColor Green Start-Process -FilePath $env:LOCALAPPDATA\Microsoft\Teams\current\Teams.exe Stop-Process -Id $PID }else{ Stop-Process -Id $PID }
Mark is an Independent Microsoft Teams Consultant with over 15 years experience in Microsoft Technology. Mark is the founder of Commsverse, a dedicated Microsoft Teams conference and former MVP. You can follow him on twitter @UnifiedVale
[…] Clear the Microsoft Teams Client Cache – Mark Vale Consulting Blog — Read on blog.valeconsulting.co.uk/2018/09/28/clear-the-microsoft-teams-client-cache/amp/ […]
Hi Mark,
Great article and thanks for sharing the script, its a pain having to filter through all the folders to remove the cache files. I have a similar ongoing support ticked open with MS right now on exactly this issue.
They asked me to clear the cache from this folder also “meeting-addin” however this requires outlook to be closed before it allows you to delete it.
cheers
laurence
Good stuff, thanks. Your script solved a display issue one of our users had within one specific channel, that prevented them from adding new content. Well done!
Hi Mark, can you say where specifically is the Teams search history? I’d like to clear that.
Thanks.
Thank you – really helpful! Is it possible to “one-click automate” this script in a simple way for a noob like me? Would be fantastic to have a “clear Teams cache” icon on the desktop until they have solved the issue?
You’d need to firsty make a registry entry to enable clicking to execute PS Scripts from shortcuts. Change this: \HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command to “C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe” “%1”
Is it possible to clear teams cache with an exception for files shared in chat?
Tx for the script, was helpful in troubleshooting my Teams issue. Didn’t solve it unfortunately. Removed guest accounts remain cached in Teams, despite the fact that they are hard-deleted from Azure. Re-adding them results in an error. Annoying. (the guest accounts have migrated to another tenant but kept their UPN)
So one question, Im I supposed to run this on each clients computer?
sorry not enough, there must be more than this. If you will check -> use the script + try to login with the user account befor. You will see no password ask. Damn MS ….
The script worked! Thank you so much!
I have several organizations/accounts that I am a guest of in Teams, and on one of those accounts, on my iPhone app, it persistently shows that I have 2 notifications. But when I go into that account, there is nothing. I have tried everything I can think of. Any ideas?
This fixed the issue for me immediately and has resolved weeks of irritation staring at a meaningless red notification icon. Thank you!
Unfortunately this did not resolve my issue. Neither did re-installing.
Back to the drawing board…
[…] I had the same problem on my computer, but clearing the Teams cache solved it.I deleted the cash by following the steps described in the blog below.https://commsverse.blog/2018/09/28/clear-the-microsoft-teams-client-cache/ […]
[…] has its cache at %AppData%MicrosoftTeams. But it looks like there may be more locations than just […]
I did all that but we still have a problem. Our teams tries a SSO with our PC login and that always fails as its not the login we use for Teams. After a couple days it will let us login again but between then and now…
Looks like M$. Why not having thousands of different cache locations?
Don’t let the dumb users understand what’s happening in Windows!
Keep it strange and complicated!
And after all:
Give them a Powershell Script to fix the damn thing!
But never ever execute Powershell Scripts using double click, because it’s too dangerous!
Wow, 13 different areas to clean to get this crappy/buggy app working again !?!?!?!?!?!?!?!?
[…] Clear the Microsoft Teams Client Cache (commsverse.blog) […]
Thank you very much for the effort. I ran the script and it worked perfectly. Very much appreciated!
Thanks, it worked well for me!
[…] Has probado también a borrar la cache de Microsoft Teams, siguiendo los pasos descritos en algún blog, como por ejemplo, este. […]
Nice job, worked great.
nice work. Thanks for the info
THIS GUY IS PRO; worked solved, thanks, be blessed.