Failed to execute backend request using Remove-MgChatMember

Copper Contributor

PowerShell ISE and 7.0

Remove-MgChatMember -ChatId string -ConversationMemberId string

fails with : Remove-MgChatMember : Failed to execute backend request.


+ CategoryInfo : InvalidOperation: ({ ChatId = 19:8...=, IfMatch = }:<>f__AnonymousType215`3) [Remove-MgChatMember_Delete], RestException`1+ FullyQualifiedErrorId : InternalServerError,Microsoft.Graph.PowerShell.Cmdlets.RemoveMgChatMember_Delete


ChatId should be correct as returned from get-MgUserChat, so I don understand why its failing.
Anyone have an idea?

1 Reply
Tested as per:

connect-mgGraph -scopes "ChatMember.ReadWrite" (successful)

Remove-MgChatMember -ChatId somthing@thread.v2 -ConversationMemberId rather_long_string

now returns:
Remove-MgChatMember : InsufficientPrivileges

+ CategoryInfo : InvalidOperation: ({ ChatId = 19:8...=, IfMatch = }:<>f__AnonymousType229`3) [Remove-MgChatMember_Delete], RestException`1 + FullyQualifiedErrorId : Forbidden,Microsoft.Graph.PowerShell.Cmdlets.RemoveMgChatMember_Delete

I initially used an AAD app registration with all the Delegated and Apprlication permissions for Chat and more, all being consented for organization, failing with the initial error in first post.

Could this all be caused of the Graph API protection?