Microsoft Teams PowerShell Report

Matt Ellis
Mar 25, 2019 · 2 min read

Updated (24/04/19): Microsoft have just released version 1.0.0 of the PowerShell module which is available here. This new module only uses 1.0 Graph APIs and Get-Team has been improved with the ability to filter and select etc, which is a good improvement. The downside is that it’s a lot slower. To run Get-Team with the beta module took a couple seconds. To run Get-Team using the new version takes about 5:40 for my 900-ish teams. Because of this the script below now takes about 17 minutes instead of around 12. This is based on ~900 teams and around 15 users per team. Hopefully this will get quicker as the Graph APIs improve.

More details on the updated module can be found here:

Have you ever looked at the Teams details in the Microsoft Teams admin center (centre, for people who can spell properly) and wanted to export it all to a CSV so you can play around with it in Excel?

Yeah, me too…

It uses one of those fancy infinite scroll features that requests more results as you scroll, which I guess means it’s unable to export to file as it hasn’t necessarily got all the results to hand.

Manage teams in Microsoft Teams admin center

I wanted to make a script that just used the native Teams PowerShell module which can be found (along with install instructions) here:

There are plenty of other way to get much more in-depth information but I wanted this to be as easy as possible to retrieve at the sacrifice of perhaps some more niche information.

The script below will do two reports for you:

Summary Report

The summary report will show everything you can see in the screenshot above.

Detailed Report

The detailed report gives you the names of every member of every Team, including their role.

As an indication of speed, in my environment the script below took 17 minutes to complete with 900-ish teams and an average of 15 users per team.

You might need to change the report output path in the two lines at the bottom very bottom, and make sure you’ve run the Connect-MicrosoftTeams cmdlet prior to running this script.

In case anyone wants it, here’s the script that worked with 0.9.6 module:

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store