Delete Microsoft Teams cache fast with this PowerShell one-liner

COVID-19 and the resulting work-from-home boom has left IT admins scrambling to find solutions that can be implemented quickly and efficiently. Many companies, especially those that have embraced Microsoft 365, turned to Microsoft Teams as their go-to employee communication and collaboration platform. But while Teams is relatively easy to use for end-users, it does sometimes pose a problem for IT pros who need to ensure it runs efficiently. One example: How do you delete the Microsoft Teams cache?

As Amy Babinchak pointed out in an excellent article here at TechGenix, finding where Microsoft Teams stores its data can be an investigative nightmare because it is, well, all over the place. As it turns out, the same is true with the Microsoft Teams cache, which is also stored in numerous locations. And there may come a time where you need to delete the Microsoft Teams cache, perhaps for routine troubleshooting or to see if doing so will improve performance. But with the cache stored in several places, you would have to delete each cache location manually.

The solution? PowerShell. This Quick Tip is courtesy of Anthony Bartolo, a senior cloud advocate for Microsoft. This one-liner cmdlet automates this process of deleting the cache. Here’s the code:

Get-ChildItem "C:\Users\*\AppData\Roaming\Microsoft\Teams\*" -directory | Where name -in ('application cache','blob storage','databases','GPUcache','IndexedDB','Local Storage','tmp') | ForEach{Remove-Item $_.FullName -Recurse -Force -WhatIf}

Bartolo points out that the -WhatIf at the end of the cmdlet “can be removed to enforce deletion.”

Leave a Comment

Your email address will not be published.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top