Controlling settings, permissions, and membership within Teams and channels
Archiving private and shared channels with -ShouldSetSpoSiteReadOnlyForMembers is supported in bulk, but a Teams Administrator role alone does not guarantee permission to demote or restore channel owners, and Microsoft’s unarchive contract does not explicitly guarantee removal of the associated SharePoint read-only setting.
Supported bulk process
For every private or shared channel:
- Export the original owners before changing anything. Record:
- Team ID
- Channel ID
- Conversation-member ID
- User ID
- Original
rolesvalue - The owner selected to remain
- Keep at least one owner. A channel without an owner cannot be archived.
- Demote every other owner by setting
rolesto an empty collection. Role updates are supported only for private and shared channels;roles = @("owner")makes a member an owner, while an empty collection makes the user a basic member. Guest roles cannot be changed this way.^1^ - Archive the channel and request read-only SharePoint permissions:
$memberBody = @{
"@odata.type" = "#microsoft.graph.aadUserConversationMember"
roles = @()
}
Update-MgTeamChannelMember `
-TeamId $teamId `
-ChannelId $channelId `
-ConversationMemberId $memberId `
-BodyParameter $memberBody
Invoke-MgArchiveTeamChannel `
-TeamId $teamId `
-ChannelId $channelId `
-ShouldSetSpoSiteReadOnlyForMembers
The archive API specifically supports shouldSetSpoSiteReadOnlyForMembers, returns 202 Accepted, and completes asynchronously. The parent team must be active.^2^
Do not treat command return as completion. For production automation, capture the operation location/status and wait for successful completion before marking that channel processed.
Authorization boundary
These operations require separate Graph OAuth permissions:
| Operation | Required Graph permission |
|---|---|
| Archive/unarchive channel | ChannelSettings.ReadWrite.All |
| Change channel member roles | Delegated ChannelMember.ReadWrite.All, or application ChannelMember.ReadWrite.Group / ChannelMember.ReadWrite.All |
Archive and unarchive explicitly support admin permissions: a Global Administrator or Microsoft Teams service administrator can operate on teams they are not a member of.^2^ ^3^
The member-role update API does not document the same Teams-service-admin access override.^1^ Therefore:
- Delegated execution: Teams Administrator plus consent to
ChannelMember.ReadWrite.Allshould not be assumed sufficient for channels the signed-in administrator cannot otherwise manage. - Tenant-wide unattended execution: use an app registration with admin-consented
ChannelMember.ReadWrite.AllandChannelSettings.ReadWrite.All. - Test shared channels involving another tenant separately; do not assume a source-tenant administrator can modify every external member or owner representation.
Reversal scenarios
Scenario 1: Keep former owners as members
Run:
Invoke-MgUnarchiveTeamChannel `
-TeamId $teamId `
-ChannelId $channelId
Unarchiving is supported and restores users’ ability to send messages and edit the channel. It is asynchronous, and the parent team must first be active.^3^
However, that documentation does not explicitly state that unarchive reverses shouldSetSpoSiteReadOnlyForMembers on the channel’s SharePoint site. Consequently, it is not sufficiently documented to promise that Scenario 1 always restores SharePoint write access.
Before bulk migration, pilot this exact sequence on one private and one shared channel:
- Archive with
-ShouldSetSpoSiteReadOnlyForMembers. - Confirm an ordinary channel member cannot modify a file.
- Unarchive and wait for asynchronous completion.
- Confirm that same member can create or modify a file in the channel site.
If write access remains blocked after successful unarchive, open a Microsoft support case rather than applying an independent SharePoint lock-state workaround to the Teams-managed site.
Scenario 2: Restore all original owners
First complete the Scenario 1 unarchive operation, then replay the saved owner manifest:
$ownerBody = @{
"@odata.type" = "#microsoft.graph.aadUserConversationMember"
roles = @("owner")
}
Update-MgTeamChannelMember `
-TeamId $teamId `
-ChannelId $channelId `
-ConversationMemberId $memberId `
-BodyParameter $ownerBody
Restore by conversation-member ID, not display name. If a user was removed rather than merely demoted, the saved membership ID might no longer be valid; add the user back to the channel before assigning the owner role.
In summary, bulk demotion, archive, unarchive, and owner restoration are available Graph operations. The two qualifications are that Teams Administrator does not by itself establish authorization for channel-member role changes, and SharePoint write-permission reversal on unarchive should be pilot-tested because that behavior is not explicitly included in the documented unarchive contract.
References