Try this one last time…
Start PowerShell as Admin and run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
taskkill /IM teams.exe /F /T
Get-ChildItem -Path ([System.Environment]::ExpandEnvironmentVariables("%AppData%\Microsoft\Teams")) -Directory | ? { $_ -in ('blob_storage','Cache','Application Cache','Code Cache','databases','GPUCache','IndexedDB','') } | % {Remove-Item $_.FullName -Recurse -Force}
Get-ChildItem -Path ([System.Environment]::ExpandEnvironmentVariables("%AppData%\Microsoft\Teams\meeting-addin")) -Directory | ? { $_ -in ('Cache','') } | % {Remove-Item $_.FullName -Recurse -Force}
Get-ChildItem -Path ([System.Environment]::ExpandEnvironmentVariables("%AppData%\Microsoft\Teams\Service Worker")) -Directory | ? { $_ -in ('CacheStorage','ScriptCache','') } | % {Remove-Item $_.FullName -Recurse -Force}
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.
C:\Users\[USERNAME]\AppData\Local\Microsoft
C:\Users\[USERNAME]\AppData\Roaming\Microsoft
C:\Users\[USERNAME]\AppData\Roaming
C:\Program Files (x86)\Teams Installer
Only move to this section if a simple uninstall and re-install didn’t work
Search Registry and CAREFULLY evaluate and delete any residual keys for Teams or “Microsoft Teams”
File\Account
taskkill /IM teams.exe /F /T
taskkill /IM outlook.exe /F /T
$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
}
}
Does Teams automatically reinstall?
No? Good
Go to https://teams.microsoft.com log in and re-install