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.
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.
Admins use this cmdlet for several reasons:
Instead of manually checking each team, this cmdlet pulls everything together in one go.
Get-MgUserJoinedTeam -UserId <String>[-Property <String[]>]
Parameters:
Get-MgUserJoinedTeam -UserId "julia.roberts@contoso.com"
This command lists all Microsoft Teams that Julia Roberts is a member of.
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.
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.
Yes! You can use the user’s email (UPN) like user@domain.com as the value for -UserId.
You need one of the following Graph API permissions:
Make sure you’re authenticated using Connect-MgGraph.
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.
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 |
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