Skip to content

Instantly share code, notes, and snippets.

@thomyg
Last active June 6, 2020 09:02
Show Gist options
  • Save thomyg/1ec1c47eb5bbcf1acaabfa2124a49c32 to your computer and use it in GitHub Desktop.
Save thomyg/1ec1c47eb5bbcf1acaabfa2124a49c32 to your computer and use it in GitHub Desktop.
#Using the Office365CLI to list all Teams apps in all Microsoft Teams teams of your tenant
o365 login -t password -u "%USER_NAME%" -p "%PASSWORD"
$availableTeams = o365 teams team list -o json | ConvertFrom-Json
if($availableTeams.count -gt 15)
{
$duration = [math]::Round(($availableTeams.count/60),1);
Write-Host "Start iterating through" $availableTeams.count "teams. This probably will take around" $duration" minutes to finish."
}
foreach ($team in $availableTeams) {
$apps = o365 teams app list -i $team.Id -a
Write-Output "All apps in team: " $team.displayName " " $team.id
Write-Output $apps
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment