How to Add a User as Owner to a Microsoft Teams Channel with PowerShell
Introduction
When managing Microsoft Teams via PowerShell, you may need to assign a user as an owner of a specific channel. However, attempting to add a user directly as an owner can result in an error if the user is not already a member of the channel.
Example Error:
Add-TeamChannelUser -GroupId $t.GroupId -DisplayName TestPermission -User AdeleV@4g6zf4.onmicrosoft.com -Role Owner
Add-TeamChannelUser: Failed to find the user: AdeleV@4g6zf4.onmicrosoft.com on the roster of channel: TestPermission.
Solution: Add as Member First, Then Promote to Owner
To successfully add a user as an owner, you must first add them as a member, then update their role to owner.
Step-by-step PowerShell:
# Add user as member first
add-teamchannelUser -GroupId $t.GroupId -DisplayName TestPermission -User AdeleV@4g6zf4.onmicrosoft.com
# Promote user as owner first
add-teamchannelUser -GroupId $t.GroupId -DisplayName TestPermission -User AdeleV@4g6zf4.onmicrosoft.com -Role Owner
Summary
You cannot add a user directly as an owner to a Teams channel if they are not already a member using MicrosoftTeams PowerShell.
Always add the user as a member first, then promote them to owner using PowerShell. This approach ensures smooth automation and avoids common errors when managing Teams channel memberships and roles.