Setup: O365 tenant with Teams
Problem: There is a private channel in a Team that is orphan – last owner left and no other user is part of that channel
Solution: Run the following PowerShell commands
Connect-MicrosoftTeams
Get-Team -DisplayName "Name of the Team"
# take note of the GroupId and replace it the below command
Add-TeamChannelUser -GroupId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx -DisplayName "<Channel name>" -User [email protected]
Add-TeamChannelUser -GroupId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx -DisplayName "<Channel name>" -User [email protected] -Role Owner
OBS. You need to run both commands in this order.
To change the owner of the SharePoint site associated with the channel:
Identify the site URL using this instructions: List all private channel’s SharePoint sites in a tenant
$SiteCollURL = "https://tenant.sharepoint.com/sites/TEAM-Channel"
$SiteOwner = "[email protected]"
Set-SPOSite -Identity $SiteCollURL -Owner $SiteOwner -NoWait