Forum Discussion
TCM001
May 03, 2023Copper Contributor
Failed to execute backend request using Remove-MgChatMember
PowerShell ISE and 7.0 Remove-MgChatMember -ChatId string -ConversationMemberId string fails with : Remove-MgChatMember : Failed to execute backend request. + CategoryInfo : InvalidOperation: (...
_CM_
May 04, 2023Copper Contributor
Tested as per: https://learn.microsoft.com/en-us/graph/api/chat-delete-members?view=graph-rest-1.0&tabs=http
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? https://learn.microsoft.com/en-us/graph/teams-protected-apis
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? https://learn.microsoft.com/en-us/graph/teams-protected-apis