How to Clear Teams Cache

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 Taskbar

    Teams need to be fully closed, so right-click on the icon in the taskbar and select Quit microsoft teams clear cache

  2. Right-click on Start and select Run

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

    Teams Cache location

  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 Teams

    You 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
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.

$clearCache = Read-Host "Do you want to delete the Teams Cache (Y/N)?"
$clearCache = $clearCache.ToUpper()

if ($clearCache -eq "Y"){
  Write-Host "Closing Teams" -ForegroundColor Cyan
  
  try{
    if (Get-Process -ProcessName Teams -ErrorAction SilentlyContinue) { 
        Get-Process -ProcessName Teams | Stop-Process -Force
        Start-Sleep -Seconds 3
        Write-Host "Teams sucessfully closed" -ForegroundColor Green
    }else{
        Write-Host "Teams is already closed" -ForegroundColor Green
    }
  }catch{
      echo $_
  }

  Write-Host "Clearing Teams cache" -ForegroundColor Cyan

  try{
    Get-ChildItem -Path $env:APPDATA\"Microsoft\teams" | Remove-Item -Recurse -Confirm:$false
    Write-Host "Teams cache removed" -ForegroundColor Green
  }catch{
    echo $_
  }

  Write-Host "Cleanup complete... Launching Teams" -ForegroundColor Green
  Start-Process -FilePath $env:LOCALAPPDATA\Microsoft\Teams\current\Teams.exe
}

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.

Leave a Comment

0 Shares
Tweet
Pin
Share
Share