All scripts
Microsoft 365 322
Get-TeamsAppUsageReport
Summarizes which third party and custom Teams apps are actually installed across teams, so licensing and security reviews are based on real usage rather than a guess.
Get-TeamsAppUsageReport.ps1
<#
.SYNOPSIS
Summarizes Teams app installation counts across all teams.
.DESCRIPTION
Enumerates installed apps for every team in the tenant and produces a
count of how many teams each app is installed in, so a security or
licensing review is based on actual usage instead of the full app
catalog.
.EXAMPLE
.\Get-TeamsAppUsageReport.ps1
.NOTES
Requires Microsoft.Graph.Teams with an active Connect-MgGraph session
and TeamsAppInstallation.Read.All scope.
.AUTHOR
Shehryar Hassan
#>
$teams = Get-MgTeam -All
$appCounts = @{}
foreach ($team in $teams) {
$apps = Get-MgTeamInstalledApp -TeamId $team.Id -ExpandProperty TeamsAppDefinition
foreach ($app in $apps) {
$name = $app.TeamsAppDefinition.DisplayName
if ($name) {
$appCounts[$name] = ($appCounts[$name] ?? 0) + 1
}
}
}
$appCounts.GetEnumerator() | Sort-Object Value -Descending |
Select-Object @{N="App";E={$_.Key}}, @{N="TeamsInstalledIn";E={$_.Value}} |
Format-Table -AutoSize
Read it before you run it, and test in a safe tenant first.