Add groupmember to security group - Error 400 Bad Request

Sindhushree K P 1 Reputation point
2022-05-11T08:05:14.02+00:00

Hi,

I followed the doc here - https://learn.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http and written powershell script to add group member using rest API's for one of my automations. But its throwing 400 status code - Bad request.
I have passed right group ID and User ID, content type as per doc. There is no duplicates in the Group, still not working. Tried to convert Json still no luck.
Asked question here as well - https://stackoverflow.com/questions/72185051/invoke-restmethod-the-remote-server-returned-an-error-400-bad-request-azur

Kindly help me out to fix this

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,645 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ShivaniRai-MSFT 2,726 Reputation points
    2022-05-11T14:05:23.317+00:00

    Hi @Sindhushree K P ,

    According to this documentation 400 Bad Request response code comes when the user is already a member of the group. And I can replicate the same.
    But as you mentioned the user is not the duplicated one then I would advise you to raise a support case with Microsoft Graph, a Support Engineer will be able to assist you better. You can raise support ticket from http://aad.portal.azure.com/ or https://admin.microsoft.com/#/support/requests.

    Just a thought Is it an ad synced group?

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.