graph api: best way to get privileged directory roles from AzureAD

Robert Cook 20 Reputation points


I am using to pull all directory roles but I only want to get the privileged roles.

These are visible on the AzureAD portal under the privileged column but I can't find a way to get the data from the Microsoft Graph API, is this possible?

I can work around it by specifying the privileged role IDs in my script but would like to automate the process for any future changes or custom role additions.


Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,511 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,380 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 94,521 Reputation points MVP

    Use the /roleManagement/directory/roleDefinitions endpoint instead:$select=id,displayName,isPrivileged

    User's image

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Givary-MSFT 27,486 Reputation points Microsoft Employee

    @Robert Cook Adding to the above answer, this graph query will help to achieve the desired result, which you are trying to do from the Azure Portal.$filter=isPrivileged eq true

    Let me know if you have any further questions, feel free to post back.

    0 comments No comments