Hi,
I'm trying to use the Graph API to create/update/delete groups and also add/remove members to groups and I was facing permission issues to remove a user from a group.
I'm using this (https://learn.microsoft.com/en-us/graph/api/group-delete-members?view=graph-rest-1.0&tabs=http) on my sandbox AAD and I tried adding different permissions from least to most privileged, but nothing worked.
So I decided to use my global admin user to test the same call, and the user was completed deleted instead of being removed from the group. I was able to restore the user from "Deleted users" and then repeat the tests again.
I've shared the verbose output from my most recent call.
INFO: Request URL: 'https://graph.microsoft.com/v1.0/groups/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/members/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/'
INFO: Request method: 'DELETE'
INFO: Request headers:
INFO: 'User-Agent': 'python/3.10.0 (Linux-5.14.18-300.fc35.x86_64-x86_64-with-glibc2.34) AZURECLI/2.30.0 (PIP)'
INFO: 'Accept-Encoding': 'gzip, deflate'
INFO: 'Accept': '/'
INFO: 'Connection': 'keep-alive'
INFO: 'Content-Type': 'application/json'
INFO: 'x-ms-client-request-id': '510024b8-49c5-4864-9a79-cb519494b7df'
INFO: 'CommandName': 'rest'
INFO: 'ParameterSetName': '--method --url --headers --body --verbose'
INFO: 'Authorization': 'Bearer xxxxxxxxxxxxx...'
INFO: 'Content-Length': '102'
INFO: Request body:
INFO: {"@odata.id":"https://graph.microsoft.com/v1.0/directoryObjects/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}
INFO: Response status: 204
INFO: Response headers:
INFO: 'Date': 'Tue, 30 Nov 2021 15:06:03 GMT'
INFO: 'Content-Length': '0'
INFO: 'Cache-Control': 'no-cache'
INFO: 'Strict-Transport-Security': 'max-age=31536000'
INFO: 'request-id': '9758aaf9-bbf5-4056-aa79-aaf4ef9549e3'
INFO: 'client-request-id': '9758aaf9-bbf5-4056-aa79-aaf4ef9549e3'
INFO: 'x-ms-ags-diagnostic': '{"ServerInfo":{"DataCenter":"West Europe","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"AM4PEPF00012FF6"}}'
INFO: 'x-ms-resource-unit': '1'
INFO: Response content:
INFO:
INFO: Command ran in 0.532 seconds (init: 0.099, invoke: 0.432)
Let me know if you need more details or if I'm doing something wrong.