api to get list of users assigned to a particular custom role in Azure AD

烈酒焚心 提交于 2020-06-29 03:40:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!