From c7953e579fc5c3bd15a528255634c1eb27970293 Mon Sep 17 00:00:00 2001 From: rustla <25848582+rustla@users.noreply.github.com> Date: Wed, 16 Aug 2023 19:53:27 +0800 Subject: [PATCH] Updated endpoint and body for Add-AzureADRole --- PowerZure.psm1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PowerZure.psm1 b/PowerZure.psm1 index b7aec78..44abc99 100644 --- a/PowerZure.psm1 +++ b/PowerZure.psm1 @@ -531,12 +531,13 @@ function Add-AzureADRole } $body = [PSCustomObject]@{ + "@odata.type" = "#microsoft.graph.unifiedRoleAssignment" roleDefinitionId = $roleid principalId = $userid directoryScopeId = '/' } $json = $body | convertto-json - Invoke-RestMethod -Headers $Headers -ContentType 'application/json' -Method POST -Body $json -Uri https://graph.microsoft.com/beta/roleManagement/entitlementManagement/roleAssignment + Invoke-RestMethod -Headers $Headers -ContentType 'application/json' -Method POST -Body $json -Uri https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments } function Get-AzureTarget