Microsoft Teams PowerShell Module (Part 1): Auditing Teams, Channels, Owners & Governance Settings (Get-Team)

Welcome to Part 1 of our Microsoft Teams PowerShell administration series. Once you have installed and connected to the module (covered in our How to Install and Connect to the Microsoft Teams PowerShell Module guide), the first priority for any Microsoft 365 administrator is visibility and auditing: knowing every Team in your tenant, who owns it, whether external guests are members, what Standard, Private, or Shared channels exist, and how member/guest permissions are configured.

When the MicrosoftTeams module first debuted in preview, retrieving all of a Team's settings required calling seven separate Get- cmdlets (Get-Team, Get-TeamFunSettings, Get-TeamGuestSettings, Get-TeamMemberSettings, Get-TeamMessagingSettings, Get-TeamChannel, and Get-TeamUser).

In modern MicrosoftTeams PowerShell (v6+), Microsoft consolidated all Fun, Guest, Member, and Messaging properties directly into the output of Get-Team, making tenant-wide governance audits dramatically faster.


Evolution of the Get-Team* Read Cmdlets (Legacy v1 vs. Modern v6+ & Graph)

Microsoft Teams PowerShell Auditing: Legacy Get-Team* vs. Modern Unified Get-Team (v6+) Legacy Module v1.x (7 Separate Calls) • Required Separate Per-Setting Cmdlets: Get-Team (Returned only GroupId, Name, Desc) Get-TeamFunSettings (Retired in v4+) Get-TeamGuestSettings (Retired in v4+) Get-TeamMemberSettings (Retired in v4+) Get-TeamMessagingSettings (Retired in v4+) ✖ High API throttling risk on large tenants Modern MicrosoftTeams v6+ (3 Core Cmdlets) 1. Get-Team - Returns ALL metadata, Fun, Guest, Member & Messaging 2. Get-TeamChannel -GroupId $Id -MembershipType - Audits Standard, Private & B2B Shared Channels 3. Get-TeamUser -GroupId $Id -Role Owner - Audits Owners, Members, and External Guests ✔ Graph Equivalents: Get-MgTeam, Get-MgTeamChannel Why Did `Get-TeamFunSettings` Stop Working in My Old Script? • Microsoft merged `Get-TeamFunSettings`, `Get-TeamGuestSettings`, `Get-TeamMemberSettings`, and `Get-TeamMessagingSettings` directly into `Get-Team`. • Simply run `Get-Team -GroupId $GroupId | Format-List *` to inspect all 22 governance properties in a single call!

1. Get-Team: Retrieve All Teams & Consolidated Governance Settings

In modern MicrosoftTeams PowerShell, running Get-Team returns every Team in the organization along with all of its Member, Guest, Messaging, and Fun settings in a single object:

POWERSHELL
# Connect to Microsoft Teams
Connect-MicrosoftTeams

# 1. List all Teams in the tenant (Summary Table)
Get-Team | Select-Object GroupId, DisplayName, Visibility, Archived, MailNickName | Format-Table -AutoSize

# 2. Filter Teams by Visibility (e.g., find all Public Teams that might expose internal data)
Get-Team -Visibility Public | Select-Object GroupId, DisplayName, Description

# 3. Filter Teams that a specific user belongs to
Get-Team -User "[email protected]" | Select-Object GroupId, DisplayName, Visibility

# 4. Inspect ALL 22 consolidated governance properties of a specific Team
Get-Team -GroupId "ee7781b7-4d45-4a39-ade4-d7872de6490c" | Format-List *

Example Consolidated Output of Get-Team | Format-List *:

Instead of calling Get-TeamFunSettings, Get-TeamGuestSettings, Get-TeamMemberSettings, and Get-TeamMessagingSettings separately, Get-Team now outputs:

  • Core Properties: GroupId, DisplayName, Description, Visibility, MailNickName, Classification, Archived
  • Member Settings (formerly Get-TeamMemberSettings): AllowCreateUpdateChannels, AllowCreatePrivateChannels, AllowDeleteChannels, AllowAddRemoveApps, AllowCreateUpdateRemoveTabs, AllowCreateUpdateRemoveConnectors
  • Guest Settings (formerly Get-TeamGuestSettings): AllowGuestCreateUpdateChannels, AllowGuestDeleteChannels
  • Messaging Settings (formerly Get-TeamMessagingSettings): AllowUserEditMessages, AllowUserDeleteMessages, AllowOwnerDeleteMessages, AllowTeamMentions, AllowChannelMentions
  • Fun Settings (formerly Get-TeamFunSettings): AllowGiphy, GiphyContentRating, AllowStickersAndMemes, AllowCustomMemes

2. Get-TeamChannel: Audit Standard, Private & Shared Channels

The Get-TeamChannel cmdlet retrieves the channels inside a Team. In modern Teams environments, you can also filter by -MembershipType (Standard, Private, or Shared B2B Direct Connect channels):

POWERSHELL
$GroupId = "ee7781b7-4d45-4a39-ade4-d7872de6490c"

# Retrieve all channels for a specific Team
Get-TeamChannel -GroupId $GroupId | Select-Object Id, DisplayName, MembershipType, Description | Format-Table -AutoSize

# Audit only Private or Shared Channels across a Team
Get-TeamChannel -GroupId $GroupId -MembershipType Private
Get-TeamChannel -GroupId $GroupId -MembershipType Shared

3. Get-TeamUser: Audit Team Owners, Members, and Guests

The Get-TeamUser cmdlet returns every user in a Team along with their UserId (Entra Object ID), User (UserPrincipalName), Name, and Role (Owner, Member, or Guest):

POWERSHELL
$GroupId = "ee7781b7-4d45-4a39-ade4-d7872de6490c"

# List all Owners, Members, and Guests in a Team
Get-TeamUser -GroupId $GroupId | Format-Table Name, User, Role -AutoSize

# Filter only Team Owners (great for finding ownerless Teams!)
Get-TeamUser -GroupId $GroupId -Role Owner

Production Runbook: Export a Complete Tenant Teams Governance & Ownerless Teams Report

One of the most common compliance tasks is identifying Ownerless Teams, Public Teams with Guest channel permissions enabled, and counting Standard, Private, and Shared channels across the tenant. Run this production script to export a full governance CSV:

POWERSHELL
# Export-TeamsGovernanceReport.ps1
Connect-MicrosoftTeams

$AllTeams = Get-Team
Write-Host "[+] Auditing $($AllTeams.Count) Microsoft Teams..." -ForegroundColor Cyan

$Report = foreach ($Team in $AllTeams) {
    $Users    = Get-TeamUser -GroupId $Team.GroupId
    $Owners   = $Users | Where-Object { $_.Role -eq "Owner" }
    $Members  = $Users | Where-Object { $_.Role -eq "Member" }
    $Guests   = $Users | Where-Object { $_.Role -eq "Guest" }
    $Channels = Get-TeamChannel -GroupId $Team.GroupId

    [PSCustomObject]@{
        GroupId                        = $Team.GroupId
        DisplayName                    = $Team.DisplayName
        Visibility                     = $Team.Visibility
        Archived                       = $Team.Archived
        OwnerCount                     = @($Owners).Count
        Owners                         = ($Owners.User -join "; ")
        MemberCount                    = @($Members).Count
        GuestCount                     = @($Guests).Count
        TotalChannels                  = @($Channels).Count
        PrivateChannels                = @($Channels | Where-Object { $_.MembershipType -eq "Private" }).Count
        SharedChannels                 = @($Channels | Where-Object { $_.MembershipType -eq "Shared" }).Count
        AllowGuestCreateUpdateChannels = $Team.AllowGuestCreateUpdateChannels
        AllowMemberCreateChannels      = $Team.AllowCreateUpdateChannels
        AllowUserDeleteMessages        = $Team.AllowUserDeleteMessages
    }
}

$Report | Format-Table DisplayName, Visibility, OwnerCount, MemberCount, GuestCount, TotalChannels -AutoSize
$Report | Export-Csv -Path "C:\Temp\Teams-Governance-Audit-$(Get-Date -Format 'yyyyMMdd').csv" -NoTypeInformation
Write-Host "[✔] Governance report exported successfully!" -ForegroundColor Green

Continue the Microsoft Teams PowerShell Series

In the next two parts of this series, we cover how to modify these settings and automate Team provisioning: