User Profile
Aleksander780
Copper Contributor
Joined Dec 08, 2022
User Widgets
Recent Discussions
Re: Microsoft Graph Remove owner of Azure Group delete the user
Just "escaping" did not help in my case, but it thrown different error which I have resolved by make URI as variable. $URL = "https://graph.microsoft.com/v1.0/groups/$groupID/owners/$userID/`$ref" $Remove = (Invoke-RestMethod -URI $URL -Headers $authHeader -Method DELETE -StatusCodeVariable:StatusCode) Now it works as it should.959Views0likes0CommentsMicrosoft Graph Remove owner of Azure Group delete the user
Hello, I have problem where I would like to remove owner of the group, but instead of the user is completely removed. I am using Azure function HTTP triggered as PowerShell with HTTPs RestMethod. Payload: { "groupID": "{group_id}", "userID": "{user_id}" } Code: $authHeader = @{ 'Authorization' = 'Bearer ' + $accessToken } $groupID = $Request.Body.groupID $userID = $Request.Body.userID $Remove = (Invoke-RestMethod "https://graph.microsoft.com/v1.0/groups/$groupID/owners/$userID/$ref" -Headers $authHeader -Method DELETE -StatusCodeVariable:StatusCode) Push-OutputBinding -Name Response -Clobber -Value ([HttpResponseContext]@{ StatusCode = $StatusCode Body = $Remove }) There is no error, code returned is 204, so as it should, everything is fine, beside the fact that user is deleted completely from the tenant. When I ran it from Graph Explorer, everything works perfectly fine as it supposed to. Any advice? Thanks, in advance.Solved1KViews0likes2Comments
Recent Blog Articles
No content to show