Get-MgUserJoinedTeam

What is Get-MgUserJoinedTeam?

Get-MgUserJoinedTeam is a Microsoft Graph PowerShell cmdlet used to retrieve the list of Microsoft Teams that a specific user is a member of. It queries Teams membership data directly from Microsoft Entra ID and Microsoft Teams via Microsoft Graph.

🚀 Community Edition Released!

Try the M365Corner Microsoft 365 Reporting Tool — your DIY pack with 20+ out-of-the-box M365 reports for Users, Groups, and Teams.

Why Use Get-MgUserJoinedTeam?

This cmdlet is especially useful for administrators who need visibility into a user’s Teams participation. From an automation perspective, it helps in:

  • Auditing user access across Teams
  • Investigating access issues or over-provisioning
  • Generating compliance and governance reports
  • Supporting joiner–mover–leaver (JML) workflows

Prerequisites

Before using this cmdlet, ensure you have:

  • Microsoft Graph PowerShell module installed
  • Appropriate permissions such as Team.ReadBasic.All or Directory.Read.All
  • An active Microsoft Graph connection

Connect-MgGraph -Scopes "Team.ReadBasic.All"


How to Use Get-MgUserJoinedTeam?

The cmdlet requires the UserId, which can be either the user’s Object ID or User Principal Name (UPN).

It can also be used without additional parameters to retrieve all Teams the user has joined or combined with -Property to limit returned data.

Basic syntax:

Get-MgUserJoinedTeam -UserId <String>

Get-MgUserJoinedTeam Examples

  • Get All Teams a User Has Joined
  • Get-MgUserJoinedTeam -UserId "user@domain.com"

    This command returns all Microsoft Teams that the specified user is currently a member of.

  • Get Specific Properties of Teams a User Has Joined
  • Get-MgUserJoinedTeam -UserId "user@domain.com" -Property "id", "displayName"

    This example retrieves only selected properties, making the output cleaner and more suitable for reporting or exports

  • Filter Teams by Display Name (Client-side Filtering)
  • Get-MgUserJoinedTeam -UserId "user@domain.com" | Where-Object { $_.displayName -like "*Sales*" }

    This example filters the Teams list to show only those Teams whose display name contains the word Sales, which is helpful for targeted audits or access verification.


Summary

Key Point Details
Cmdlet Name Get-MgUserJoinedTeam
Purpose Retrieves the list of Microsoft Teams a specific user has joined
Required Scope Team.ReadBasic.All or Directory.Read.All
Primary Parameters UserId (UPN or Object ID)
Automation Benefit Enables auditing, reporting, and access reviews for Teams memberships
Common Use Case Checking user access during onboarding, offboarding, or security audits

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