SOLVED

List of all apps used in teams inside tenant

Copper Contributor

Hello,

Company, what I'm responsible for, wants to disable all 3rd party applications in Teams. But before disabling, they want to know, if there's any used in any team. I've found, that I can check apps used in particular Team by providing Team ID and by using Graph API, but I need to check ALL Teams created in tenant for ALL 3rd party apps (or even any apps, I will determine which one is 3rd party one). I have full list of all teams available in my tenant. I need to know how to iterate API query for this list.



Could you please help me? :)

6 Replies
best response confirmed by ThereseSolimeno (Microsoft)

@Vasil Michev  thank you, I've used your idea to create my own solution - I used PowerAutomate (Flow) to generate output file.

Hi what is requested to handle this:
$client_secret = Get-Content .\ReportingAPIsecret.txt | ConvertTo-SecureString

I have a registered graph App in the tenant, but what is need to do in addition?
That's just an example on how to store the client secret in a more secure way, instead of pasting it in plain text in the script file. If you haven't worked with secure strings in PowerShell, check this article: https://www.pdq.com/blog/secure-password-with-powershell-encrypting-credentials-part-1/
Or you can just replace all that code with your own preferred method to obtain a token.
Ok but even if i copy the secret key into the script it doesnt work for me
You have to replace the entire "get token" section. Like this:

$tenantID = "tenant.onmicrosoft.com"
$appID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$client_secret = "verylongsecurestring"

$body = @{
client_id = $AppId
scope = "https://graph.microsoft.com/.default"
client_secret = $client_secret
grant_type = "client_credentials"
}
1 best response

Accepted Solutions