Forum Discussion

JeanPhilippe's avatar
JeanPhilippe
Copper Contributor
Dec 13, 2024

Add parent team in a shared channel with powershell

Hello, I'm trying to add the team, where my shared channel is, as a member oh this channel but I can't find the good command. The last one I used is :

$TeamGrouId = "000-000-000-000" #ID de l'équipe concernée

$Channel = "Mon canal partagé"

$channelID = (Get-TeamChannel -GroupId $TeamGroupId | Where-Object {  $_.DisplayName -Like $Channel}).Id

$paramstest = @{

    "@odata.type"    = "microsoft.graph.aadUserConversationMember"

    roles            = @("member")

    "*** Adresse électronique supprimée pour cause de confidentialité ***" = "https://graph.microsoft.com/v1.0/groups/$TeamGroupId" 

    }

Add-MgTeamChannelMember -TeamId $TeamGroupId -ChannelId $channelId -BodyParameter $paramstest

The error message I'm encoutering is : 

Add-MgTeamChannelMember : Bind requests not expected for action payload.

Status: 400 (BadRequest)

ErrorCode: BadRequest

 

If anyone have a solution :-)

 

Best regards

 

P.S. : I'm french so my english may be a little bad.

 

No RepliesBe the first to reply

Resources