问题
I need an api that list the users assigned to a particular custom role in Azure AD or an api that gives the assigned roles, both built-in roles and custom roles of a particular user. Can anyone suggest the api. Thanks in advance
回答1:
From the below query, you will get roledefinitionid by giving object-id-of-principal(userID)
https://graph.microsoft.com/beta/roleManagement/directory/roleAssignments?$filter=principalId eq '<object-id-of-principal>'
Once you receive the role definition id of a specific user you can fetch the role details(built-in and Custome role) by giving ID(roledefinitionid)
https://graph.microsoft.com/beta/roleManagement/directory/roleDefinitions/ID
来源:https://stackoverflow.com/questions/61908762/api-to-get-list-of-users-assigned-to-a-particular-custom-role-in-azure-ad