Skip to main content

Is your Microsoft Teams working slow or won’t it start at all? Then clearing your Microsoft Teams cache will probably solve the issue. You can safely clear the Teams Cache, you won’t lose any chat history because these are stored online in Office 365.

In this article, I will explain how you can delete the Teams cache quickly, and at the end of the article, I have also a PowerShell script that can be used to delete the cache remotely.

Clear Microsoft Teams Cache

Time needed: 2 minutes.

We will first take a look at how to remove the cache in Windows.

  1. Close Microsoft Teams in the TaskbarTeams need to be fully closed, so right-click on the icon in the taskbar and select Quit

2. Right-click on Start and select Run

– Or press the Windows key + R
– Type the path %appdata%\Microsoft\ and press Enter

3. Delete the folder Teams

You can safely delete the folder teams, this will only clear the local Teams cache on your computer. It won’t delete your chat history.

4. Restart TeamsYou can now restart Microsoft Teams. It will take a bit longer than normal because Teams will need to rebuild the cache.

Clear Microsoft Teams Cache on macOS

The steps for macOS are basically the same, only we will be using the Terminal to remove the cache folder.

  1. Make sure that Teams is fully closed, right-click on Teams and select Quit
  2. Open the Terminal – Use the Spotlight Search button or Command + Space and type Terminal
  3. Type the command below and press enter
1.  rm -r ~/Library/Application\ Support/Microsoft/Teams

This will remove the Teams cache folder on your Mac completely. You can now restart Teams.

Using PowerShell to delete Teams Cache

When you need to remove the cache on multiple computers, or on a remote computer, then you can use the PowerShell script below. It will first ask for confirmation and then close Teams, remove the cache and restart Teams again.

If you want to use the script in a deployment tool, then you can simply copy the part inside the first If statement.

1.  $clearCache = Read-Host "Do you want to delete the Teams Cache (Y/N)?"<font></font>
2.  $clearCache = $clearCache.ToUpper()<font></font>
3.  <font></font>
4.  if ($clearCache -eq "Y"){<font></font>
5.    Write-Host "Closing Teams" -ForegroundColor Cyan<font></font>
6.    <font></font>
7.    try{<font></font>
8.      if (Get-Process -ProcessName Teams -ErrorAction SilentlyContinue) { <font></font>
9.          Get-Process -ProcessName Teams | Stop-Process -Force<font></font>
10.         Start-Sleep -Seconds 3<font></font>
11.         Write-Host "Teams sucessfully closed" -ForegroundColor Green<font></font>
12.     }else{<font></font>
13.         Write-Host "Teams is already closed" -ForegroundColor Green<font></font>
14.     }<font></font>
15.   }catch{<font></font>
16.       echo $_<font></font>
17.   }<font></font>
18. <font></font>
19.   Write-Host "Clearing Teams cache" -ForegroundColor Cyan<font></font>
20. <font></font>
21.   try{<font></font>
22.     Get-ChildItem -Path $env:APPDATA\"Microsoft\teams" | Remove-Item -Recurse -Confirm:$false<font></font>
23.     Write-Host "Teams cache removed" -ForegroundColor Green<font></font>
24.   }catch{<font></font>
25.     echo $_<font></font>
26.   }<font></font>
27. <font></font>
28.   Write-Host "Cleanup complete... Launching Teams" -ForegroundColor Green<font></font>
29.   Start-Process -FilePath $env:LOCALAPPDATA\Microsoft\Teams\current\Teams.exe<font></font>
30. }

Wrapping Up

I have had a couple of occations where Teams wouldn’t rebuild the chat history after removing the cache. In these cases you will need to take a couple of extra steps as described in this article.

Clearing the Teams cache should resolve most issues with Microsoft Teams. I hope this articled helped you, if you have any questions, just drop a comment below.