Did you consider using -NumberOfThreads parameter? This could speed-up the process.
Martin
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I've been trying to use the following powershell command to get all the tenant teams
Get-Team -Archived $false | Export-csv c:\output.csv
But because of the number of teams we have in our tenant 40k+ it times out with the following error
Get-Team : Error occurred while executing
Code: InvalidAuthenticationToken
Message: Access token has expired or is not yet valid.
Is there a way to refresh the token so this doesn't happen or get a sub-set of the teams i.e all those starting with a or the first 10K, second 10K
Thanks
Did you consider using -NumberOfThreads parameter? This could speed-up the process.
Martin
Hi there,
To list all teams in an organization (tenant), you find all groups that have teams, and then get information for each team.
To get a list of all groups in the organization that have teams, get a list of all groups and then in code find the ones that have a resourceProvisioningOptions property that contains "Team". Since groups are large objects, use $select to only get the properties of the group you care about.
You can follow this link for the detailed process
List all teams in Microsoft Teams for an organization
https://learn.microsoft.com/en-us/graph/teams-list-all-teams
------------------------------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer--