Uninstall Microsoft Teams cleanly

AutoStart Settings

Go to Teams and set it to not auto-start, nor open in background, or stay open when running and don’t have it set for chat app.

Once Teams is uninstalled cache files cleared and registry cleared, these should be moot.

Uninstall Teams

  1. Quit Teams by right-clicking the Teams icon in the taskbar and choosing Close window.
  2. In Windows, click on the Start button  Start button , > Settings > Apps.
  3. Under Apps & features, search “teams”.
  4. Highlight Microsoft Teams, then select Uninstall
  5. A box will appear, then again select Uninstall to confirm. A new box will appear, asking Do you want to allow this app to make changes to your device? Select Yes.
  6. Now select Teams Machine-Wide Installer, click Uninstall. Then follow the same process described in step 5
  7. Delete any remnant cache files

Delete Cache and other files

C:\Users\[USERNAME]\AppData\Local\Microsoft

Or Add/Remove Programs

Delete Teams Installer

C:\Program Files (x86)\Teams Installer

Registry

Search Registry and CAREFULLY evaluate and delete any residual keys for Teams or “Microsoft Teams”

Log out of Microsoft Office

Go to Word

File\Account

Clear Credentials

Control Panel\User Accounts\Credential Manager

Remove User from Access Work & School

Rename the AAD BrokerPlugin

# Rename the AAD BrokerPlugin directories to try to avoid TPM errors when using Office

$ProfilesDirectoryPath = (Get-ItemProperty -Path “registry::HKLM\Software\Microsoft\Windows NT\CurrentVersion\ProfileList” -Name ProfilesDirectory).ProfilesDirectory

$ProfileDirectories = Get-ChildItem -Path $ProfilesDirectoryPath -Directory

$UniqueRenameKey = ([guid]::newguid()).tostring().replace(‘-‘,”)

try{

        $Renames = (Get-ItemProperty ‘registry::HKLM\SYSTEM\CurrentControlSet\Control\Session Manager’ -Name PendingFileRenameOperations -ErrorAction SilentlyContinue).PendingFileRenameOperations

        if( $Renames ) {

               $Renames = $Renames | ? { $_ -notlike ‘*Microsoft.AAD.BrokerPlugin_*’ }

        }

} catch {

}

if( -not $Renames ) {

        $Renames = @()

}

Foreach( $ProfileDirectory in $ProfileDirectories ) {

        $AppDataPackagesPath = (‘{0}\AppData\Local\Packages’ -f $ProfileDirectory.FullName )

        if( Test-Path $AppDataPackagesPath ) {

               $MicrosoftAADBrokerPluginPackages = Get-ChildItem $AppDataPackagesPath -Directory -Filter ‘Microsoft.AAD.BrokerPlugin_*’

               Foreach( $MicrosoftAADBrokerPluginPackage in $MicrosoftAADBrokerPluginPackages ) {

                       $Renames += (‘\??\{0}’ -f $MicrosoftAADBrokerPluginPackage.FullName)

                       $Renames += (‘\??\{0}_{1}’ -f $MicrosoftAADBrokerPluginPackage.FullName, $UniqueRenameKey)

               }

        }

        $UserClassPath = (‘{0}\AppData\Local\Microsoft\Windows\UsrClass.dat’ -f $ProfileDirectory.FullName )

        if( Test-Path $UserClassPath ) {

               $Renames += (‘\??\{0}’ -f $UserClassPath)

               $Renames += (‘\??\{0}_{1}’ -f $UserClassPath, $UniqueRenameKey)

        }

}

if( $Renames ) {

        try{

               $DontSave = Get-ItemProperty ‘registry::HKLM\SYSTEM\CurrentControlSet\Control\Session Manager’ -Name PendingFileRenameOperations -ErrorAction SilentlyContinue

               Set-ItemProperty ‘registry::HKLM\SYSTEM\CurrentControlSet\Control\Session Manager’ -Name PendingFileRenameOperations -Value $Renames

        } catch {

               New-ItemProperty ‘registry::HKLM\SYSTEM\CurrentControlSet\Control\Session Manager’ -Name PendingFileRenameOperations -Value $Renames -PropertyType MultiString | Out-Null

        }

}

REBOOT

Does Teams automatically reinstall?

No?  Good

Reinstall Teams

Go to https://teams.microsoft.com log in and re-install

Conrad Murray

Conrad Murray is a Microsoft Certified IT consultant working in IT for over 20 years specialising in the Messaging arena and in particular Office 365 and previously Microsoft Exchange On-Premises and IBM Domino. Working with like minded colleagues now delivering very large scale complex migrations from Office 365 to Office 365 (tenant to tenant), Lotus Notes and On-Premises Microsoft Exchange to Office 365.

Leave a Reply

Your email address will not be published. Required fields are marked *

Search