08-09-2020 05:20 PM
08-09-2020 05:20 PM
I have recently been tasked with doing some reporting on Teams usage for our organisation. Being familiar with PowerShell this seemed like the logical choice to me for retrieving the data, however I have been getting some very strange results when using v1.1.4 of the "MicrosoftTeams" module downloaded from the PowerShell gallery.
Our company has hundreds of Teams, yet when I run the cmdlet "Get-Team" it takes an hour or so to retrieve just 4 results. Unfortunately I am not an administrator for Office365 however I would think if this was the root of the issue it would either return nothing or everything, not just a few Teams! Another thing I considered was perhaps the results returned were only for Teams that I am a "Owner" of, however when using the cmdlet with the -DisplayName flag to specify other Teams I could return any other team I wanted to. This is obviously not the ideal way to retrieve all the data we need and my understanding was that the Get-Team cmdlet should return all results for the company. This combined with the fact that it takes over an hour to produce the same 4 results each time has me wondering what could possibly be happening in the background; it seems that something is not configured correctly or there is a bug within the Get-Team cmdlet since it should not take that long to return results from Azure!
Has anyone else had similar issues? What might I do to better diagnose / resolve the problem?
Thanks in advance!
08-10-2020 09:06 AMSolution
Seems to be working fine here, but it certainly wont be the first time the module has had issues. I'd suggest using the unified group cmdlets wherever possible instead, or even doing direct Graph API calls via PowerShell. As for the issue at hand, you can open a support case and report it.
08-11-2020 05:47 AM
@Vasil Michev Thanks for this information, much appreciated! I did some digging but unfortunately couldn't find out which PS module contained the unified group cmdlets... However I had more luck when investigating Microsoft Graph and this looks like really good solution; it has a very comprehensive API and was fast to connect. I setup an App Registration and got it to authenticate correctly, now all I need to do is request Admin approval for reading the data with my script!