Avec l'arrivée du New Teams, les IT ont besoin d'inventorier les appareils Windows qui l'ont installé et qui l'utilisent.
Ceci est possible en utilisant un script de remédiation Intune, qui fera le check continu sur tous les appareils concernés.
Script de détection :
function Is-NewTeamsInstalled {
return (Get-AppxPackage *MSTeams* -ErrorAction SilentlyContinue) -ne $null
}
# Function to check if Microsoft Teams is the default IM app
function Is-NewTeamsDefault {
$registryPath = "HKCU:\Software\IM Providers"
$registryKey = "DefaultIMApp"
$defaultValue = Get-ItemProperty -Path $registryPath -Name $registryKey -ErrorAction SilentlyContinue
return ($defaultValue -ne $null) -and ($defaultValue.DefaultIMApp -eq "MSTeams")
}
# Main script logic
$teamsInstalled = Is-NewTeamsInstalled
$teamsDefault = Is-NewTeamsDefault
if ($teamsInstalled -and $teamsDefault) {
Write-Host "New Teams installed and is set Default!";Exit 0
}
elseif ($teamsInstalled -or $teamsDefault) {
Write-Host "New Teams installed but not set Default."
Exit 1
}
else {
Write-Host "New Teams not installed."
Exit 1
}