Get-Team -User PowerShell for Teams

%3CLINGO-SUB%20id%3D%22lingo-sub-499316%22%20slang%3D%22en-US%22%3EGet-Team%20-User%20PowerShell%20for%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-499316%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20created%20a%20test%20environment%20on%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Foffice%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Foffice%3C%2FA%3E%26nbsp%3Bto%20test%20the%20Teams%20PS%20commands.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20the%20Team%20PowerShell%20version%201.0%20installed.%26nbsp%3B%20When%20I%20run%20the%20following%20command%20it%20displays%20all%20teams%20rather%20than%20the%20ones%20the%20user%20is%20a%20member%20of.%26nbsp%3B%20I%20tried%20several%20users%2C%20which%20have%20different%20memberships%2C%20however%20the%20command%20just%20returns%20all%20the%20groups.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEx%3A%26nbsp%3B%3CSTRONG%3EGet-Team%20-User%20user1%40domain.onmicrosoft.com%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20help%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-499316%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ETeams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-499664%22%20slang%3D%22en-US%22%3ERe%3A%20Get-Team%20-User%20PowerShell%20for%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-499664%22%20slang%3D%22en-US%22%3EHmmm.%20Strange%20behaviour!%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fteams%2Fget-team%3Fview%3Dteams-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fteams%2Fget-team%3Fview%3Dteams-ps%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EIt%20actually%20specifies%3CBR%20%2F%3E%3CBR%20%2F%3EExample%201%3CBR%20%2F%3EPS%26gt%3B%20Get-Team%20-User%20dmx1%40example.com%3CBR%20%2F%3EReturns%20all%20teams%20that%20a%20user%20(dmx1%40example.com)%20belongs%20to%3CBR%20%2F%3E%3CBR%20%2F%3EPerhaps%20this%20is%20a%20bug%3F%20May%20be%20worth%20a%20ticket%3F%3CBR%20%2F%3E%3CBR%20%2F%3EBest%2C%20Chris%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-501790%22%20slang%3D%22en-US%22%3ERe%3A%20Get-Team%20-User%20PowerShell%20for%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-501790%22%20slang%3D%22en-US%22%3EWhich%20version%20of%20the%20module%20are%20you%20using%3F%20I%20cannot%20reproduce%20the%20issue%20with%201.0.0.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-503834%22%20slang%3D%22en-US%22%3ERe%3A%20Get-Team%20-User%20PowerShell%20for%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-503834%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1023%22%20target%3D%22_blank%22%3E%40Jeremy%20Miller%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EModule%20is%201.0.0%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20742px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111114iCBA81E4C6BBF33D1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Version1.png%22%20title%3D%22Version1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EPlease%20see%20details%3A%3C%2FP%3E%3CP%3EAll%20teams%20listed%20below%20on%20my%20test%20environment%3A%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20928px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111115iFD601F242639090B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22all%20teams.PNG%22%20title%3D%22all%20teams.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Eadded%20users%20to%20specific%20teams%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20392px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111117i543BFD54449B34C7%2Fimage-dimensions%2F392x272%3Fv%3D1.0%22%20width%3D%22392%22%20height%3D%22272%22%20alt%3D%22user1.png%22%20title%3D%22user1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20372px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111130iE38BF211C9FED1E2%2Fimage-dimensions%2F372x289%3Fv%3D1.0%22%20width%3D%22372%22%20height%3D%22289%22%20alt%3D%22user3.png%22%20title%3D%22user3.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHowever%2C%20using%20the%20command%20Get-Team%20-User%20%3CUSER%3E%20displays%20all%20teams%20rather%20than%20the%20ones%20that%20the%20users%20are%20a%20member%20of.%3C%2FUSER%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20923px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111122i2093EFDCBBFC450C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22user33.png%22%20title%3D%22user33.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20903px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F111120iD06B1B7FDEFA4F16%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22user11.png%22%20title%3D%22user11.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-508953%22%20slang%3D%22en-US%22%3ERe%3A%20Get-Team%20-User%20PowerShell%20for%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-508953%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F329701%22%20target%3D%22_blank%22%3E%40aphamer%3C%2FA%3E%20I've%20been%20testing%20and%20still%20cannot%20recreate%20but%20it%20is%20obviously%20happening%20for%20you%20as%20indicated%20by%20the%20screenshots.%26nbsp%3B%20If%20you%20still%20have%20the%20issue%20it%20is%20probably%20worth%20opening%20a%20support%20ticket%20as%20mentioned%20by%20someone%20above.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-509600%22%20slang%3D%22en-US%22%3ERe%3A%20Get-Team%20-User%20PowerShell%20for%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-509600%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F329701%22%20target%3D%22_blank%22%3E%40aphamer%3C%2FA%3E%20repeating%20the%20request%20to%20file%20a%20support%20ticket%20-%20we'd%20love%20to%20deep-dive%20what%20you're%20experiencing%20to%20see%20if%20there's%20a%20bug%20that%20needs%20fixing!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-771238%22%20slang%3D%22en-US%22%3ERe%3A%20Get-Team%20-User%20PowerShell%20for%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-771238%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F329701%22%20target%3D%22_blank%22%3E%40aphamer%3C%2FA%3E%26nbsp%3BI%20have%20just%20run%20this%20command%20and%20it%20returned%20a%20list%20of%20teams%20that%20I%20am%20a%20member%20of%20instead%20of%20the%20specified%20user.%20Is%20it%20possible%20that%20you%20are%20a%20member%20of%20all%20those%20teams%20and%20thats%20the%20bug%3F%20Or%20maybe%20my%20bug%20is%20different%20to%20yours%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-790148%22%20slang%3D%22en-US%22%3ERe%3A%20Get-Team%20-User%20PowerShell%20for%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-790148%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F329701%22%20target%3D%22_blank%22%3E%40aphamer%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20wrote%20a%20script%20for%20this.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fkorniienkoalexis%2FGet-Team%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fkorniienkoalexis%2FGet-Team%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-869323%22%20slang%3D%22en-US%22%3ERe%3A%20Get-Team%20-User%20PowerShell%20for%20Teams%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-869323%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20experiencing%20the%20same%20issue%20with%201.0.2%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-Team%20-User%20%3CUSERNAME%3E%20regardless%20of%20whom%20I%20put%20it%20only%20ever%20returns%20my%20own%20teams%20(i.e.%20the%20account%20I%20connected%20with)%20although%20I%20am%20a%20global%20admin.%26nbsp%3B%3C%2FUSERNAME%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-Team%20with%20no%20-User%20parameter%20return%20all%20teams.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20find%20a%20fix%20for%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello,

 

I created a test environment on https://developer.microsoft.com/en-us/office to test the Teams PS commands. 

 

I have the Team PowerShell version 1.0 installed.  When I run the following command it displays all teams rather than the ones the user is a member of.  I tried several users, which have different memberships, however the command just returns all the groups.

 

Ex: Get-Team -User user1@domain.onmicrosoft.com

 

Can anyone help?

8 Replies
Highlighted
Hmmm. Strange behaviour!

https://docs.microsoft.com/en-us/powershell/module/teams/get-team?view=teams-ps

It actually specifies

Example 1
PS> Get-Team -User dmx1@example.com
Returns all teams that a user (dmx1@example.com) belongs to

Perhaps this is a bug? May be worth a ticket?

Best, Chris
Highlighted
Which version of the module are you using? I cannot reproduce the issue with 1.0.0.
Highlighted

@Jeremy Miller 

Module is 1.0.0
Version1.png

Please see details:

All teams listed below on my test environment:
all teams.PNG

added users to specific teams

user1.png

user3.png

However, using the command Get-Team -User <user> displays all teams rather than the ones that the users are a member of.

user33.png

user11.png

Highlighted

@aphamer I've been testing and still cannot recreate but it is obviously happening for you as indicated by the screenshots.  If you still have the issue it is probably worth opening a support ticket as mentioned by someone above.

Highlighted

@aphamer repeating the request to file a support ticket - we'd love to deep-dive what you're experiencing to see if there's a bug that needs fixing!

Highlighted

@aphamer I have just run this command and it returned a list of teams that I am a member of instead of the specified user. Is it possible that you are a member of all those teams and thats the bug? Or maybe my bug is different to yours?

Highlighted
Highlighted

I am experiencing the same issue with 1.0.2

 

Get-Team -User <username> regardless of whom I put it only ever returns my own teams (i.e. the account I connected with) although I am a global admin. 

 

Get-Team with no -User parameter return all teams.

 

Anyone find a fix for this?