🔧 New: User Management Graph PowerShell Toolkit

Simplify user tasks like bulk creation, updates, password resets, deletions, license checks & more — all from one place.

🚀 Launch Toolkit

Retrieve Microsoft Teams Channel Permissions Using Graph PowerShell

Managing Microsoft Teams settings at scale can be cumbersome through the Teams Admin Center. This Graph PowerShell script allows administrators to quickly audit key team channel permissions across all Teams within a tenant — without having to click through each team manually.


The Script

# Get all groups that are provisioned as Teams
$teams = Get-MgGroup -Filter "resourceProvisioningOptions/Any(x:x eq 'Team')" -All
foreach ($team in $teams) {
    $teamId = $team.Id
    $teamDetails = Get-MgTeam -TeamId $teamId
    Write-Host "Team Name: $($team.DisplayName)"
    Write-Host "AllowCreateUpdateChannels: $($teamDetails.MemberSettings.AllowCreateUpdateChannels)"
    Write-Host "AllowCreatePrivateChannels: $($teamDetails.MemberSettings.AllowCreatePrivateChannels)"
    Write-Host "AllowDeleteChannels: $($teamDetails.MemberSettings.AllowDeleteChannels)"
    Write-Host "`n"
}
                            

How the Script Works

  1. Get-MgGroup: The script filters all Microsoft 365 Groups that are Teams using the resourceProvisioningOptions filter.
  2. Get-MgTeam: For each group identified as a Team, it retrieves detailed team settings using the TeamId.
  3. MemberSettings: This section contains the core properties of interest:
    • AllowCreatePrivateChannels
    • AllowCreateUpdateChannels
    • AllowDeleteChannels
  4. Output: The script builds a custom PowerShell object with these properties and outputs:
    • Team Name
    • Description
    • Member permissions (Create, Update, Delete)
  5. Export: All collected data is exported to Teams_Channel_Permissions_Report.csv in the script directory.

Further Enhancements

Here are a few ways to expand the script:

  • Add Owner & Member Counts: Include user statistics for each team.
  • Include Visibility: Add whether the Team is private or public.
  • Schedule Regular Reports: Automate this script to run weekly and email the report.
  • Merge with Messaging Settings: Combine member and messaging settings in a single audit report.

Possible Errors & Solutions

Error Cause Solution
Get-MgTeam : Cannot bind argument to parameter 'TeamId' because it is null. One of the groups may not be a valid Team or is improperly provisioned. Use try/catch to skip and log failed entries (already handled in the script).
Missing required property 'memberSettings' Rarely, some Teams may not return full settings. These are often transient API issues. Consider retry logic or skip with warning.
Access Denied or Unauthorized Insufficient Graph API permissions. Ensure the signed-in user has Team.Read.All or Group.Read.All delegated/admin consent.

Conclusion

This script provides Microsoft 365 administrators with a quick, scalable way to audit Microsoft Teams channel-related permissions, especially the ability to create, update, and delete channels. Rather than visiting each Team through the admin portal, this Graph PowerShell-based approach saves hours of manual effort.

Using this script, admins can:

  • Spot overly permissive settings.
  • Ensure governance policies are respected.
  • Export detailed reports for compliance reviews.

Graph PowerShell Explorer Widget

20 Graph PowerShell cmdlets with easily accessible "working" examples.


Permission Required

Example:


                


                


                

© m365corner.com. All Rights Reserved. Design by HTML Codex