Forum Discussion
Older versions of Teams are still appearing in the registry for other user profiles and are being fl
I'm having the same problem. I can't find Classic Teams installed on any of our endpoints, but Sentinel One keeps reporting CVEs from it on them all. Was there ever a fix?
I have a script that detects and cleans teams classic from endpoint.
You can test this on few of your endpoints to see if it works for you.
Remember to open powershell with admin priviledges
# Get all user profiles on the machine (excluding special/system profiles)
$users = Get-WmiObject -Class Win32_UserProfile | Where-Object { $_.Special -eq $false }
foreach ($user in $users) {
$sid = $user.SID
$profilePath = $user.LocalPath
$ntUserDatPath = "$profilePath\NTUSER.DAT"
$teamsLocalAppDataPath = "$profilePath\AppData\Local\Microsoft\Teams"
Write-Host "Processing user profile: $profilePath (SID: $sid)"
# Remove Teams data folder from LocalAppData for each user
if (Test-Path $teamsLocalAppDataPath) {
Write-Host "Removing Teams application data from $teamsLocalAppDataPath"
Remove-Item -Path $teamsLocalAppDataPath -Recurse -Force
} else {
Write-Host "Teams data folder not found for user: $profilePath"
}
# Check if NTUSER.DAT file exists for the user profile (for registry cleanup)
if (Test-Path $ntUserDatPath) {
# Load the user's registry hive into HKEY_USERS
reg load "hku\$sid" "$ntUserDatPath" | Out-Null
# Set the path to the Teams uninstall registry key for the loaded hive
$uninstallKey = "Registry::HKEY_USERS\$sid\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Teams"
# Check if the Teams uninstall registry key exists
if (Test-Path -Path $uninstallKey) {
Write-Host "Removing Teams uninstall registry entry for user: $profilePath"
# Remove the Teams uninstall entry
Remove-Item -Path $uninstallKey -Recurse -Force
} else {
Write-Host "No Teams uninstall entry found for user: $profilePath"
}
# Unload the user's registry hive from HKEY_USERS
reg unload "hku\$sid" | Out-Null
} else {
Write-Host "NTUSER.DAT not found for user profile: $profilePath, skipping..."
}
}
# Remove Teams from the machine-wide installed applications
Write-Host "Uninstalling Teams Classic from the machine..."
$app = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "*Microsoft Teams*" }
if ($app) {
$app.Uninstall()
Write-Host "Teams Classic uninstalled from the machine."
} else {
Write-Host "Teams Classic is not installed at the machine-wide level."
}
Write-Host "Teams Classic cleanup complete for all users."