Unable to add channel owners to private channels via PowerShell
Using https://www.poshtestgallery.com/packages/MicrosoftTeams/1.0.21 when I try and use the following command Add-TeamChannelUser -GroupId $groupid -DisplayName $displayname -User $username -Role Owner
I get the following error message
add-TeamChannelUser : Error occurred while executing
Code: BadGateway
Message: Failed to execute backend request.
InnerError:
RequestId: c126b7db-90c8-4d66-93f4-651952924734
DateTimeStamp: 2020-04-17T00:25:07
HttpStatusCode: BadGateway
At line:1 char:1
+ add-TeamChannelUser -GroupId <groupid> -Di ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-TeamChannelUser], ApiException
+ FullyQualifiedErrorId : Microsoft.TeamsCmdlets.PowerShell.Custom.ErrorHandling.ApiException,Microsoft.TeamsCmdlets.PowerShell.Custom.AddTeamChannelUser
However if I use the GUI I can add owners to a private channel. This means that I cannot script adding channel owners but rather must add each owner the slow way through the GUI.
This has already been reported here https://github.com/MicrosoftDocs/OfficeDocs-SkypeForBusiness/issues/3753 but that ticket was closed.

4 comments
-
Miguel commented
Maybe it's too late but the solution to this problem is to first add the user as a member and the upgrade role to owner (as indicated in the doc)
"To turn an existing Member into an Owner, first Add-TeamChannelUser -User foo to add them to the members list, then Add-TeamChannelUser -User foo -Role Owner to add them to owner list."
So you have to execute :
Add-TeamChannelUser -GroupId $groupid -DisplayName $displayname -User $username
and the upgrade to owner :
Add-TeamChannelUser -GroupId $groupid -DisplayName $displayname -User $username -Role Owner
-
TC commented
Same issue in MicrosoftTeams Beta 1.0.25. Only members can be added.
-
David Pettitt commented
I am experiencing the same issue. As per the suggestion in the GitHub ticket, I raised a support ticket with Microsoft Support. They ended up telling me it's not possible to add Owners to a memberless Private Channel, and directed me here to UserVoice.
-
Harold Van de Kamp commented
Same issue here!