Thursday, June 1, 2023

An error occurred while executing Add-TeamChannelUser to add the user to the private channel and make them an owner - Could not find the member

Last year, Microsoft introduced a public preview PowerShell module (2.0) to enable the addition of users to private groups and channels using the Add-TeamChannelUser cmdlet. This feature was later included in the GA release.

Recently, I found myself migrating from Slack to Teams and had over 20 private channels that required the addition of a new owner. I needed to add this user to the group.

When running the below command, I get an error "Error occurred while executing - Could not find the member."

Add-TeamChannelUser -GroupId $group.GroupID -User "stajone@domain.com" -DisplayName the_coalition -Role Owner


Resolution -

  • You need to manually add the user to the group via PowerShell.
    • Add-TeamUser -GroupID/DisplayName "Test Group" -User stajone@domain.com -Role Owner
  • Add the user to the private channel as a member first.
    • Add-TeamChannelUser -GroupId $group.GroupID -User "stajone@domain.com" -DisplayName the_coalition
  • Promote the user as a private channel owner.
    • Add-TeamChannelUser -GroupId $group.GroupID -User "stajone@domain.com" -DisplayName the_coalition -Role Owner

No comments:

Post a Comment