How can I get the list of Teams a user belongs to using PowerShell?

Darrel Miller 11 Reputation points Microsoft Employee
2021-02-22T14:24:48.25+00:00

Using PowerShell I would like to retrieve the list of Teams that a user is a member of.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,404 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vasil Michev 100.1K Reputation points MVP
    2021-02-22T14:57:30.987+00:00
    2 people found this answer helpful.
    0 comments No comments

  2. Darrel Miller 11 Reputation points Microsoft Employee
    2021-02-22T14:29:49.353+00:00

    You can get a list of Teams that a user is a member of by using the Microsoft Graph PowerShell module.

    $user = get-MgUser -Filter "DisplayName eq '<User Name>'"  
    get-MgUserJoinedTeam -UserId $user.Id  
    
    0 comments No comments