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

Peter King

Peter King has been Managing Editor at TechGenix since July 2016. As a technology editor, reporter, and columnist, he has worked at some of the biggest U.S. newspapers, where he directed coverage of breaking news stories and steered award-winning projects from conception to publication.

Share
Published by
Peter King

Recent Posts

Secure your WordPress website: Simple steps to stay safe

Many small businesses use WordPress to build their website. And while WordPress has many options…

2 hours ago

Qumulo raises $125M for cloud data management across a hybrid setup

Qumulo is an up-and-coming data management solution focusing on managing files in a hybrid setup.…

3 days ago

Why SMBs need a standalone solution for Windows 10 patch management

Is patch management for the Windows PCs at your business driving you crazy? Maybe there's…

3 days ago

Microsoft Teams guest access: How to enable and manage it

Two of the main factors that affect the total cost of an organization’s Microsoft 365…

4 days ago

Samsung Galaxy Unpacked 2020: Everything you need to know

Samsung rolled out the all-new Galaxy Z Fold 2, Note 20, Note 20 Ultra handsets…

4 days ago

SAN vs. NAS: Detailed comparison of these two storage technologies

SAN and NAS provide dedicated storage for a group of users using completely different approaches…

4 days ago