Get-MgTeam is a Microsoft Graph PowerShell cmdlet used to retrieve details of Microsoft Teams within your Microsoft 365 tenant. It allows administrators to list all teams, filter results, or retrieve specific team details using the team’s unique ID.
The Get-MgTeam cmdlet is ideal for automation scenarios such as:
This automation saves time, reduces manual lookups in the Teams admin center, and supports bulk administrative tasks.
Before using Get-MgTeam, ensure you have the Microsoft Graph PowerShell module installed and the necessary permissions granted.
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Team.ReadBasic.All"
Get-MgTeam -TeamId <id>
The cmdlet can be used to list all teams, fetch details for a specific team, or filter/search results to match your requirements.
Get-MgTeam -All
Get-MgTeam -TeamId "5b34b8a4-6e77-4d8a-94eb-9b150d938f97"
Get-MgTeam -Filter "displayName eq 'MSFT'"
Get-MgTeam -All -Property "id", "displayName"
$users = Import-Csv "C:\Path\To\Users.csv"
$teams = Get-MgTeam -All | Where-Object { $_.displayName -like '*Sales*' }
$teams | ForEach-Object {
"Team ID: $($_.Id) Team Name: $($_.displayName)"
}
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