Get all Teams in a Tenant using Microsoft Graph.

Paul Keijzers [#MVP]
Paul Keijzers (@KbWorks)
3 min readAug 2, 2018

--

A frequently question is how can we get all Teams that exist in my office 365 tenant. Well there are a few ways to do that. The most common was Powershell. But to do this you needed assign license and permissions to the account that was getting the info.

Now Microsoft just released a new Beta Graph api which makes it possible to get the info of all groups as a admin. You can find the documentation here.

GET /groups?$filter=resourceProvisioningOptions/Any(x:x eq ‘Team’)

So how does this work? Well graph is great and you could use it in a flow to provision a list or anything else in this case I will show the easiest way to get all the info.

First you need to go to graph.microsoft.com. Here you can go to the graph explorer.

Now we need to sign in to our Admin account. To do this we click on the left Sign in with Microsoft. After Signin it will ask your admin consent to get specific items in Office 365. When that is done you will see this screen. We will need extra permissions to get the teams. So we need to click on Modify permissions.

Once we clicked that we will get a screen with permissions. You will need to search for the permission Group.Read.All. In my case I already have some more permissions. but be sure to have the one selected in red. Then click Modify permissions.

After that we will go back to the main screen. As it is still in Beta we have to change v1.0 to beta.

Now we have to fill in the url with the correct address “https://graph.microsoft.com/beta/groups?$filter=resourceProvisioningOptions/Any(x:x eq ‘Team’)”

After we have done that we need to click on run query and the result will be in the response preview.

As this is JSON a enduser can not do anything with that. So what I suggest is to copy the JSON and go to a website which compiles it to CSV for example this site.

After pasting the JSON. It will directly convert into csv.

This a enduser understands and it will give you all the info of your teams.

Hope this helps to get the most out of teams.

--

--