Bulk demoting multiple channel owners and making private/shared channel SharePoint sites read-only, and reversing it

Rajendra Prasad Karicheti 0 Reputation points
2026-11-28T14:15:58.5+00:00

During a cross-tenant SharePoint migration, we need to make source private and shared channel sites read-only. Set-SPOSite -LockState ReadOnly doesn't work on these Teams-managed sites (TEAMCHANNEL#0/#1). For one shared channel that had multiple owners, we demoted all of them to member, kept one admin account as the only owner, and archived the channel in Teams with "Make the SharePoint site read-only for team members" ticked, which made the channel read-only as expected.

Is it supported and achievable to do this in bulk across many private and shared channels, each with multiple owners, using Microsoft Graph PowerShell and the Teams Administrator role? That is: demote all owners except one with Update-MgTeamChannelMember, then archive with Invoke-MgArchiveTeamChannel -ShouldSetSpoSiteReadOnlyForMembers.

We also need to reverse it in bulk in two possible ways:

  • Scenario 1: keep the demoted owners as members and only take the channel and its SharePoint site out of read-only, with Invoke-MgUnarchiveTeamChannel.
  • Scenario 2: take the channel and its SharePoint site out of read-only, and restore all the original owners.

Does unarchiving fully remove the read-only state on the channel's SharePoint site, and is this the supported approach for both scenarios?

Microsoft Teams | Microsoft Teams for business | Teams and channels | Manage a team or channel
0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-11-28T14:18:24.5566667+00:00

    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:

    1. Export the original owners before changing anything. Record:
      • Team ID
      • Channel ID
      • Conversation-member ID
      • User ID
      • Original roles value
      • The owner selected to remain
    2. Keep at least one owner. A channel without an owner cannot be archived.
    3. Demote every other owner by setting roles to 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^
    4. 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.All should 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.All and ChannelSettings.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:

    1. Archive with -ShouldSetSpoSiteReadOnlyForMembers.
    2. Confirm an ordinary channel member cannot modify a file.
    3. Unarchive and wait for asynchronous completion.
    4. 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

    1. Update member in channel
    2. channel: archive
    3. channel: unarchive
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.