In the past two weeks I had the problem with some customers that Teams got stuck in a "boot loop". The user only saw "Microsoft Teams loading…".
You can easily solve this problem by cleaning the Teams cache. To delete the Teams cache centrally for all users, I wrote a PowerShell script that can be distributed with Intune.

This is what the boot loop looks like, an error is not displayed even after waiting 20 minutes:

Teams

Delete Teams Chache manual

You can clear the Teams cache manually on the device for the current user with a one-liner in PowerShell and for all users on the device with admin rights.

# All Users
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 }

# Current User
Stop-Process -Name Teams; Get-ChildItem -Path "$env:USERPROFILE\AppData\Roaming\Microsoft\Teams" -Directory | Where{$_ -in ('Cache','databases','blob_storage','IndexedDB','GPUCache','Local Storage','tmp','')} | ForEach{Remove-Item $_.FullName -Recurse -Force}
Code language: PowerShell (powershell)

Delete Teams Chache via Intune

I have also written a PowerShell script to delete the Teams cache with Intune once at system start-up. You can simply distribute this via Intune. The script executes the following tasks:

  • At the first run:
    • The script saves itself on the device.
    • Creates a scheduled task that is executed as the system at system start-up.
  • At the second run (via Scheduled Task):
    • Teams Cache will be deleted for all users.
    • Scheduled Task will be deleted.
    • The script deletes itself (so no old scripts on the device)

To distribute the script, you can simply create a new PowerShell script in Intune under "Devices > Windows > PowerShell scripts" as a system in the 64-bit context and assign it to the desired group.

PowerShell script Intune, title and description
run as system in 64bit context