Forum Discussion
PowerShell: Get-Team unreliable / returning incomplete results
We are experiencing the same reliability issues with the Get-Team command.
We script delta files from exports from our LMS and Teams (using Get-Team). But often Get-Team is missing a few (sometimes many) Teams, which leads to already existing Teams being flagged as missing and queued for creation.
It is the only thing that stops us from fully automating Teams/LMS synchronization.
UlrikSS
Any news about this? With the latest teams module (4.9.3) there are still issues when quering teams. It seems this has been an issue for quite some time now.
the help states that is only a filter but not an exact match which is unfortunately. It would speed up scripting much more if it would return an exact match.
Curious to know if still more people have issues with teams like that a TeamChannel is created but not the SharePoint folder that should come with it.
- CloudSnoutAug 02, 2023Copper Contributor
Erwin_de_Jong
The issue still persists but you can fix it with piping the output like below.get-team -DisplayName $team.Name | Where-Object Displayname -eq $team.nameI totally agree that it shouldn't work like this, but it's a workaround.
- SteveBlackburnSep 17, 2024Copper Contributor
This is a good workaround if Get-Team returns the team you are after, however sometimes it finds similar names but not the one you are after - even though it exists. You then get a null result so no GroupID to work with.