Teams-enabled O365 Groups report workaround in PowerShell
With the current (0.9.1) beta version of the Teams PowerShell module, as has been pointed out in other posts, the Get-Team command only returns Teams you -- the user running the command -- are a member of. However, as community member Nino Paulo found in another thread specific to the Graph API endpoint, we can use the error codes we get back from some of the related Teams commands to work around the current limitation. This can work for PowerShell as well, which may fit better into existing workflows and admin experience.
Following is a snippet that uses the Get-UnifiedGroup Exchange Online PS command to get all O365 Groups, then uses the Get-TeamChannel Microsoft Teams PS command across them and based on the response (no error, a 403 Access Denied error, or a 404 Not Found error) reports whether the O365 Group is TeamsEnabled. This can stand as its own .ps1, can fit into another script, or the output can be modified as needed (for example, output Primary SMTP rather than Azure AD Group ID). Note as written it does need to have an Exchange Online PS session and Microsoft Teams PS session already connected to work.
Re: Teams-enabled O365 Groups report workaround in PowerShell
Thanks Dave, using Get-TeamChannel is an interesting way to figure out whether a group is team-enabled.
One of the wonders of PowerShell is how easy it is to take different bits of code and stitch them together. I took your code and some code I had for reporting obsolete Office 365 Groups and created a report, which might be easier to process than looking at PowerShell output. All improvements are gratefully accepted.