This is a rant and a solution
This is the solution that works in my environment. I cannot speak to how this may work in other environments.
I have a backstory on this one here. I have been dealing with the removal of the Classic version of Teams off and on for about 6-7 months now. Microsoft really made me go ape on this one. I was trying to remove the Classic Teams off of devices through scripts from forum posts, Reddit posts, Microsoft scripts, Microsoft Teams Admin Portal, and Microsoft Teams bootstrapper exe switches and nothing worked 100%. The most success I found was building out my own script that was a combination of a few scripts with my tweaks and deploying it as a Remediation Script via Intune.
While my script would remove the application from a majority of devices it didn’t remove the leftover reg keys in the current user hive. Now this matters to me because our Cybersecurity unit would badger us every now and then about the high Microsoft Defender vulnerability score it would produce. I know that on certain devices the app is completely gone but those leftover reg keys are what Microsoft Defender detects to show that it’s “installed”… thanks Microsoft. Trying to remove those keys was a real pain in the keyster because the profile needed to be loaded to remove it. I sat on it for a while until the holy grail of scripts came out, from Microsoft themselves. The script Microsoft made came out a bit after the end of Classic Teams so users that did still have the classic on their device would have it pop up for them to upgrade to new Teams, which they couldn’t because they do not have admin rights to install apps without a domain admin account.
Now that the rant is over, I’ll briefly discuss the Microsoft script that fixed all of my problems. Below I will link the script. The only thing I added to this script is right at the top I added a line to kill the Classic Teams task (PS Line below). Since deploying the script via Intune Scripts, Classic Teams has been purged off the rest of our devices and the vulnerability score in Microsoft Defender has gone from around 5000 exposed devices to now 100.
Stop-Process -Name “Teams” -Force
https://learn.microsoft.com/en-us/microsoftteams/teams-client-uninstall-script