0
votes

I'm trying to figure out a correct way to list our Office 365 groups that have Microsoft Teams linked to them.

However, when I run this request, it's not returning all of our O365 groups: https://graph.microsoft.com/v1.0/groups

Then again, this request will return all of the groups: https://graph.microsoft.com/v1.0/groups?$orderby=displayName

Finally, if I try searching for the groups in PowerShell, this happens:

  • Get-AzureADGroup (with Azure Active Directory PowerShell Version 2)
    • NOT OK - Only some groups returned
  • Get-MsolGroup (with Azure Active Directory PowerShell Version 1)
    • OK - All groups returned
  • Get-AzureADGroup -ObjectId
    • Using the ID found with Get-MsolGroup
    • OK - The group is found even though it was not in the list of all groups

So I have to say I'm a bit confused. Any idea of what's going on? What's the request I should use in Graph API to list (and potentially update) all O365 groups?

2
The problem here could be the number of groups that are getting returned. I know that the Graph API has a default limit on the number of objects returned with a query. Can you check if the size of the list of groups returned is some round even number?Shawn Tabrizi
../groups is a superset of all groups and should return more than just Office 365 groups (if you have things like DLs, security groups etc). Per Shawn's comment, is it possible that you are not paging through the results? By default, groups will return a page of 100 groups, and provide an "@odata.nextLink" to fetch the next page of groups...Dan Kershaw - MSFT
Thank you guys! /groups was indeed returning only the first 100 results, and using "@odata.nextLink" solves my problem.Eero Talonen

2 Answers

0
votes

https://graph.microsoft.com/beta/me/joinedTeams will return all the Teams-enabled groups I'm a member of. See this topic.

There's no API currently that will list all Teams-enabled groups in the tenant. Do you have a scenario for why you are looking for this API? This could be something we add in the future.

Hope this helps,

0
votes

As I know, there is no API to list all teams enabled group directly.

But you can use list endpoints api to check if there is teams endpoint: https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/group_list_endpoints

So you can check group one by one, and then get all teams enabled groups.