To export team members and owners in Microsoft Teams, list the teams with Get-Team, then read each team's users with Get-TeamUser, which returns a role for each person. That takes 1 call per team, so a large tenant is slow. Archived teams are included unless you filter them out.
| Method | Best fit |
|---|---|
| PowerShell | A CSV with 1 row per person in every team, read with the Microsoft Teams module. |
| Admin centre | Reading the owners, members and guests of 1 team, 1 team at a time. |
| Altivane | Recommended for regular team membership reviews, with owners listed first and a workbook to keep. |
Before you start
Use a Teams Administrator or Global Administrator account. With a lesser role the Teams cmdlets return only the teams the account owns or belongs to. The example asks for no permission: its access is the signed-in account's role.
The script reads membership as Teams holds it when it runs, so the CSV is a snapshot. It lists every person Get-TeamUser returns for each team, with their role, and a team with no users has no rows. The examples read and export; they change nothing.
Option 1
Export team members with PowerShell
Install the module once, then connect, read every team's users and export 1 row per person. Any error stops the script before it writes a partial CSV.
# Install once, if the module is not already installed.
Install-Module MicrosoftTeams -Scope CurrentUser$ErrorActionPreference = 'Stop'
Connect-MicrosoftTeams | Out-Null
try {
$teams = @(Get-Team)
$report = @(foreach ($team in $teams) {
Get-TeamUser -GroupId $team.GroupId |
Select-Object @{ Name = 'Team'; Expression = { $team.DisplayName } }, *
})
if ($report.Count -eq 0) {
Write-Output 'No team members were found.'
} else {
$report | Sort-Object Team, Name |
Export-Csv -Path './team-members.csv' -NoTypeInformation -Encoding utf8
Write-Output "$($report.Count) team members exported from $($teams.Count) teams."
}
} finally {
Disconnect-MicrosoftTeams
}The CSV has 1 row for each person in each team: the team's name, then the columns Get-TeamUser returns (the user principal name, user ID, name and role). To narrow it, add -Archived $false or -Visibility Private to Get-Team, or -Role Owner to Get-TeamUser to keep owners only. In Microsoft Graph PowerShell, Get-MgTeamMember -TeamId reads a team's members and needs at least TeamMember..
Check a single team
Reconnect with Connect-MicrosoftTeams, then read 1 team's users. The main export above disconnects when it finishes.
# Run while connected to Microsoft Teams. Replace the example name.
Get-Team -DisplayName 'Contoso Marketing' |
ForEach-Object { Get-TeamUser -GroupId $_.GroupId }The name is a filter, so it can return more than 1 team. Use -GroupId for an exact match.
Option 2
View team members in the admin centre
- Sign in to the Microsoft Teams admin centre for the correct tenant.
- Go to Teams > Manage teams. The grid shows the Team members, Owners and Guests counts for each team. If a column is missing, select the Edit columns icon, turn it on and select Apply.
- Select a team's name to open its profile page.
- Read the people listed as the team's owners, members and guests. Do not use the controls that add or remove people.
This suits checking 1 team, such as before an offboarding. It does not suit an export: names appear on 1 team's profile page at a time.
Option 3 ยท Recommended for team membership reviews
Run Altivane's Team Members report
- Open Altivane and choose the tenant.
- Run the Team Members report for Teams. Its Speed is Slow because it reads members 20 teams at a time.
- Open the Excel workbook and read each row's Team, Team email, Member, Member email and Role.
- Rows cover every person in each team, including archived teams, with teams in name order and owners first, then members, then guests. Role says Owner, Member or Guest. A team whose members cannot be read has no rows; it is named in the log and the report is partial. Team Inventory lists every team with its owners and counts.
Beside it, Team Inventory lists every team with its owners and counts.
Contact usCommon questions
How do I tell guests from members?
Altivane's Role column says Guest. In the Teams admin centre, the Guests column counts them and the team's profile page lists them. In PowerShell, Get-TeamUser filters on a role of Owner or Member; Get-MgTeamMember returns guest in the roles of an in-tenant guest and nothing for a basic member.
Why does the script return only some of my teams?
With a role below Teams Administrator, the Teams cmdlets return only the teams the signed-in account owns or belongs to. Sign in with a Teams Administrator or Global Administrator account to read every team.
How do I find teams that have no owner?
Read each team's owners and keep the teams where the list is empty. The steps are in how to find teams without owners in Microsoft Teams.
Microsoft references
Technical references checked on 5 October 2026. The example scripts have been reviewed and syntax checked; they have not been run against a live tenant.