How to Use Get-MgUserJoinedTeam to Fetch Microsoft Teams a User Has Joined?

If you're a Microsoft 365 admin looking to identify which Teams a user has joined, the Get-MgUserJoinedTeam cmdlet in Microsoft Graph PowerShell can make your job a lot easier. This cmdlet provides a simple, efficient way to retrieve a list of Microsoft Teams that a specific user is a member of.

Let’s break it all down in this step-by-step guide.

What is Get-MgUserJoinedTeam?

Get-MgUserJoinedTeam is a Microsoft Graph PowerShell cmdlet that retrieves all Microsoft Teams that a specific user is a member of. It queries the Graph API for team memberships based on a user's ID or User Principal Name (UPN).

This cmdlet is especially useful when auditing user access or troubleshooting Teams-related issues.

Why Use Get-MgUserJoinedTeam?

Admins use this cmdlet for several reasons:

  • Audit team memberships for individual users
  • Troubleshoot access issues in Microsoft Teams
  • Clean up inactive or unnecessary memberships
  • Generate reports on team participation across your organization

Instead of manually checking each team, this cmdlet pulls everything together in one go.

Cmdlet Syntax

Get-MgUserJoinedTeam -UserId <String>[-Property <String[]>]

Parameters:

  • -UserId: Required. This can be the user's UPN (e.g., user@domain.com) or their GUID.
  • -Property: Optional. Specify the properties you want to retrieve, such as "id", "displayName", etc.

Usage Examples

  1. Get All Teams a User Has Joined
  2. Get-MgUserJoinedTeam -UserId "julia.roberts@contoso.com"

    This command lists all Microsoft Teams that Julia Roberts is a member of.

  3. Get Specific Properties of Teams a User Has Joined
  4. Get-MgUserJoinedTeam -UserId "julia.roberts@contoso.com" -Property "id", "displayName"

    This command fetches only the team ID and display name for each team Julia has joined, making the output cleaner for reporting.

  5. Export User's Teams to a CSV File
  6. Get-MgUserJoinedTeam -UserId "julia.roberts@contoso.com" -Property "id", "displayName" |
    Select-Object id, displayName |
    Export-Csv -Path "JuliaTeams.csv" -NoTypeInformation
                                                

    This command exports the team list to a CSV file, which is perfect for audits or documentation.

Frequently Asked Questions

  • Can I use email instead of user ID?
  • Yes! You can use the user’s email (UPN) like user@domain.com as the value for -UserId.

  • What permissions do I need to run this?
  • You need one of the following Graph API permissions:

    • Delegated: Team.ReadBasic.All
    • Application: Team.ReadBasic.All or Team.Read.All

    Make sure you’re authenticated using Connect-MgGraph.

  • Can I use this for bulk users?
  • The cmdlet works for one user at a time, but you can loop through a list of users from a CSV or array to fetch each user's joined teams.

Use Cases

Scenario How Get-MgUserJoinedTeam Helps
User Offboarding Review and document team memberships before account deactivation
Access Review Validate user access during a quarterly security audit
Helpdesk Support Identify Teams a user is part of when they report missing content
Team Cleanup Detect inactive users in teams for better team hygiene

Conclusion

The Get-MgUserJoinedTeam cmdlet is a must-have tool in any Microsoft 365 administrator’s toolkit. Whether you're conducting routine audits, resolving user access issues, or generating compliance reports, this cmdlet simplifies the process of retrieving team membership details for any user.

Next time you need to track which Teams a user has joined—skip the manual checks and use PowerShell instead!

Did You Know? Managing Microsoft 365 applications is even easier with automation. Try our Graph PowerShell scripts to automate tasks like generating reports, cleaning up inactive Teams, or assigning licenses efficiently.

Ready to get the most out of Microsoft 365 tools? Explore our free Microsoft 365 administration tools to simplify your administrative tasks and boost productivity.

© Your Site Name. All Rights Reserved. Design by HTML Codex