In Part 1 of this post i demonstrated how to list all external team members with team owners and team name. Although this returned the data that we want. it doesn’t present it in a format that is easy to read and work with.
In this post i will show you how to get this data in a clear format where you can export it to PDF, CSV or just copy it to your clipboard.
This is what the data will look like at the end.

The script.
After researching some other blogs and coming across the wonderful “out-htmlview”. And coming across this post by Alexander. I was able to finally achieve a report that is comprehensive, tidy and informative.




The Source Code
I hope that this can prove useful!
And, im actually really interested in hearing from people who are better than me with powershell on how you would do things differently and improve the speed of this script!
If you are looking for guidelines on how you should govern teams in your organisation take a look at my post on Microsoft Teams Governance!
Thanks for reading!
Hi Omar,
thanks for mention my blogpost on your great blog. If you have any further questions let me know.
Alexander
No problem!
Thanks for the script, it seems to show numbers but no data.
Hi Robert – Are you able to perhaps link to a screenshot of what you see? Furthermore, if you try and run only certain parts of the script at a time – are you able to see data or does it only show numbers still?
worked like a charm.
Initially I have had also only numbers but you need to let the report run. Which can take quite some time if you have a lot of TEAMS.
Output is an awesome html file with a search function in it!
All what we needed!
Thx a bunch
I also get the numbers.
And in the end it shows “WARNING: Out-HtmlView – No data available.”
We have
I figured it out. We have only internal teams and internal members. (No users with the guest role)
So I commented out this line “#$users = (Get-TeamUser -GroupId $team.groupid | Where-Object {$_.Role -eq “Guest”})”
And ran the foreach loop against the $teamowners object in stead of the $extuser.