powershell and teams

%3CLINGO-SUB%20id%3D%22lingo-sub-2648547%22%20slang%3D%22en-US%22%3Epowershell%20and%20teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2648547%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20am%20trying%20the%20below%20snippet%26nbsp%3B%20and%20powershell%20showing%20%22fetiching%26nbsp%3B%20%25%20percentage%20%22%20and%20it%20becoming%20very%20slow%26nbsp%3B%3C%2FP%3E%3CP%3Eget-team%20%7Cwhere-object%20%7B%20%24_.mailnickname%20-eq%20%24team.TeamsName%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20help%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2648547%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2650173%22%20slang%3D%22en-US%22%3ERe%3A%20powershell%20and%20teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2650173%22%20slang%3D%22en-US%22%3EHelp%20with%20what%20exactly%3F%20It's%20normal%20for%20the%20cmdlet%20to%20take%20some%20time%20to%20complete%2C%20especially%20in%20large%20organizations.%20Moreover%2C%20Teams%20PowerShell%20is%20not%20exactly%20known%20for%20it's%20speed.%20You%20can%20try%20calling%20the%20Graph%20API%20directly%2C%20or%20if%20you%20are%20looking%20for%20specific%20team%2C%20use%20filtering%3A%20%3CBR%20%2F%3E%3CBR%20%2F%3EGet-Team%20-MailNickName%20%22Marketing%22%3C%2FLINGO-BODY%3E
Contributor

Hi,

I am trying the below snippet  and powershell showing "fetiching  % percentage " and it becoming very slow 

get-team |where-object { $_.mailnickname -eq $team.TeamsName}

 

Please help 

Thanks 

 

3 Replies
Help with what exactly? It's normal for the cmdlet to take some time to complete, especially in large organizations. Moreover, Teams PowerShell is not exactly known for it's speed. You can try calling the Graph API directly, or if you are looking for specific team, use filtering:

Get-Team -MailNickName "Marketing"
Hi,
I am filtering for specific teams , still it is taking around 2-3 minute

get-team |where-object { $_.mailnickname -eq $team.TeamsName}

Thanks
You are filtering client side, this means PowerShell will need to fetch the full list of teams anyway. Use the example above.