Notification

Icon
Error

Microsoft Teams Cache Deletion - Deletes the roaming profile cache for Teams

Posted: Thursday, August 5, 2021 4:35:48 AM(UTC)
baritonechimpanzee

baritonechimpanzee

Member Original PosterPosts: 3
1
Like
This script (via Powershell) deletes the roaming profile cache(s) on the target machine. Helpful in a non persistent environment that hasn't used the "Machine Wide Installer".

I used this links as reference:

PowerShell Basics: How to Delete Microsoft Teams Cache for All Users

It wont delete in use files so if a user is logged on using teams it wont delete their files.

You can add a " -WhatIf " statement to the end (see below) and run locally to receive feedback to see what's going to be removed:

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}

This script will also be subject to powershell access and application control/restrictions remote execution if its saved as a *.PS1 etc. I've used a *.BAT to run the script or as system account that's isn't restricted
Microsoft Teams Cache DeletionDownload Package
DescriptionDeletes Not In Use Teams Cache Files
Final ActionNothing
Max. Duration2 min(s), 0 hour(s)
RescanNo
Steps
1. PowerShell.exe
TypeCommand
Return Codes 0,1641,3010
SuccessStop (Success)
FailureStop (Failure)
Command 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}
Mr Bass
#1Mr Bass Member Posts: 4  
posted: 10/27/2021 3:19:20 PM(UTC)
Originally Posted by: baritonechimpanzee Go to Quoted Post
This script (via Powershell) deletes the roaming profile cache(s) on the target machine. Helpful in a non persistent environment that hasn't used the "Machine Wide Installer".

I used this links as reference:

PowerShell Basics: How to Delete Microsoft Teams Cache for All Users

It wont delete in use files so if a user is logged on using teams it wont delete their files.

You can add a " -WhatIf " statement to the end (see below) and run locally to receive feedback to see what's going to be removed:

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}

This script will also be subject to powershell access and application control/restrictions remote execution if its saved as a *.PS1 etc. I've used a *.BAT to run the script or as system account that's isn't restricted


This package is not working for me. d'oh!

I did it with a file.bat in my shared folder, the bat:
Quote:

@ECHO OFF
goto:main

[+] Description: Close, clean cache and restart Teams

:main

taskkill /f /t /fi "IMAGENAME eq teams.exe"
echo "[x] Teams Closed!!!!"
del /f /q "%appdata%\Microsoft\teams\application cache\cache\*.*" > nul 2>&1
del /f /q "%appdata%\Microsoft\teams\blob_storage\*.*" > nul 2>&1
del /f /q "%appdata%\Microsoft\teams\databases\*.*" > nul 2>&1
del /f /q "%appdata%\Microsoft\teams\GPUcache\*.*" > nul 2>&1
del /f /q "%appdata%\Microsoft\teams\IndexdDB\*.db" > nul 2>&1
del /f /q "%appdata%\Microsoft\teams\Local Storage\*.*" > nul 2>&1
del /f /q "%appdata%\Microsoft\teams\tmp\*.*" > nul 2>&1
echo "[+] Cache has been deleted!!!"
C:\Users\%USERNAME%\AppData\Local\Microsoft\Teams\Update.exe --processStart Teams.exe
echo "[+] Teams Started!!!"
echo "DONE"


If someone needs...

Active Discussions

Lansweeper ManageEngine ADSelfService Plus Vulnerability
by  TheGift73   Go to last post Go to first unread
Last post: 11/30/2021 10:25:01 AM(UTC)
Lansweeper OS: Not latest Build of Windows 10 not working
by  Luke Maslany  
Go to last post Go to first unread
Last post: 11/29/2021 2:01:49 PM(UTC)
Lansweeper Cannot find right class
by  FabioB   Go to last post Go to first unread
Last post: 11/29/2021 8:16:33 AM(UTC)
Lansweeper vCenter vSphere Web Client Vulnerabilities
by  Esben.D  
Go to last post Go to first unread
Last post: 11/25/2021 12:24:24 PM(UTC)
Lansweeper Report for Hardware Maintenance
by  PBjelly   Go to last post Go to first unread
Last post: 11/23/2021 2:53:33 PM(UTC)
Lansweeper Need a little help here
by  AMcCarron  
Go to last post Go to first unread
Last post: 11/18/2021 3:07:25 PM(UTC)
Lansweeper Solftware Installed by member of AD Group
by  RPZ   Go to last post Go to first unread
Last post: 11/17/2021 9:57:42 PM(UTC)
Lansweeper Uptime Report duplicate powerstates
by  INNO-IT  
Go to last post Go to first unread
Last post: 11/16/2021 5:10:23 PM(UTC)