Teams Per User Install Automated Uninstall

Copper Contributor

Hi Everyone,

We have an issue in our environment where users of generic kiosk devices are installing Microsoft Teams on these devices via the per user install. We are working on an app restriction GPO to prevent the install but I have yet to find an automated, clean, way to parse user profiles and uninstall Microsoft Teams per user installs. 

I found a script online and it cleans up all the files associated with the install but leaves various data in the HKCU registry hives so our MECM client is capturing that it is still installed even though it is not. 

 

Any suggestions?

 

I've attached the script here for your review.

 

Nate

4 Replies
Hi,

briefly to understand: are you talking about the machine-wide installer or does each user install the product for themselves?

If it is the machine-wide installer and you are using a software distribution, I would recommend you run the machine-wide installer MSI with the /uninstall parameter, then run the script to clean up the individual folders. This at least cleaned up all the registry entries for us last time.
Nope, not the Machine wide installer. Users are downloading it and installing it via per user install such as the install that comes up when you click on a link to join a meeting.
I would suggest that you use PowerShell to search HKEY_USERS on each PC and delete your keys. The key is the same on all PCs, right?

If you add HKEY_USERS as PSDrive (New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS), you should be able to search it normally with Get-Childitem <Name> -Recurse.
Have you ever worked with powershell before?
I have, not a whole lot but I have, that is a good idea. Let me try to see what I can write up!
Nate