💬 Detect Teams Version Installed
Intune Remediation · Reports which Teams versions are installed
Detection only. No remediation script attached, the output lands in the remediation report.
Detection Script
D
Report installed Teams versions detection
Always exits 0. The output column in the report carries the answer.
›
# Reports which versions of Teams are installed.
$NewTeams = Get-AppxPackage -AllUsers -Name MSTeams -ErrorAction SilentlyContinue
$ClassicTeams = Get-ChildItem 'C:\Users\*\AppData\Local\Microsoft\Teams\current\Teams.exe' -ErrorAction SilentlyContinue
$UninstallKeys = @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*'
'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*'
)
$Installer = Get-ItemProperty $UninstallKeys -ErrorAction SilentlyContinue |
Where-Object DisplayName -like 'Teams Machine-Wide*'
$Result = ''
if ($NewTeams) { $Result += 'New Teams. ' }
if ($ClassicTeams) { $Result += 'Classic Teams. ' }
if ($Installer) { $Result += 'Machine-Wide Installer. ' }
if ($Result -eq '') { $Result = 'No Teams found.' }
Write-Output $Result
exit 0
Intune Remediation Settings
Run this script using the logged on credentials
No
Enforce script signature check
No
Run script in 64-bit PowerShell host
Yes
Schedule (recommended)
Daily