How to retrieve all directory roles in Microsoft Entra ID

Directory roles in Microsoft Entra ID define what admin actions users and groups can take. For IT admins, knowing which roles exist, what they allow, and who holds them is key to governance. Since roles change as organizations grow, it helps to have a simple way to review them. Fortunately, there are reliable ways to retrieve all directory roles in Microsoft Entra ID.

  • M365 admin center
  • PowerShell
  • ADManager Plus
 

How to list all directory roles in Microsoft Entra ID using the Microsoft Entra admin center

  1. Sign in to the Microsoft Entra admin center.
  2. Navigate to Entra ID > Roles & admins.
  3. Choose All roles.
  4. You will see the full list of directory roles, with the option to filter by role type if needed.
A comprehensive list of all directory roles in the Microsoft Entra admin center.

How to get all directory roles in Microsoft Entra ID using Windows PowerShell

  • Connect to the Microsoft Microsoft Graph PowerShell.
    Connect-MgGraph -Scopes "Directory.Read.All"
  • Use the below cmdlet to list all active directory roles.
    Get-MgDirectoryRole
  • To get details for a specific directory role, use the following cmdlet.
    Get-MgDirectoryRole -DirectoryRoleId "<RoleObjectId>"

Example to list all directory roles assigned to the tenant

Example query:

Connect-MgGraph -Scopes "Directory.Read.All"
Get-MgDirectoryRole

Example output:

Id: 12a34b56-cd78-90ef-gh12-3456abcd7890
DisplayName: Global Administrator
Description: Can manage all aspects of Microsoft Entra ID and Microsoft services
RoleTemplateId: 8e3af657-a8ff-443c-a75c-2a2b47c6fa7b
Id: 23b45c67-de89-01fg-hi23-4567bcde8901
DisplayName: User Administrator
Description: Can manage users and user-related aspects
RoleTemplateId: fe930be7-5e62-47db-91af-98c3a49a38b1

How to get all directory roles in Microsoft Entra ID using Microsoft Graph PowerShell

The syntax is as follows:

Get-MgDirectoryRole
[-ExpandProperty <string[]>]
[-Property <string[]>]
[-Filter <string>]
[-Search <string>]
[-Skip ]
[-Sort <string[]>]
[-Top ]
[-ResponseHeadersVariable <string>]
[-Break]
[-Headers <IDictionary>]
[-HttpPipelineAppend <SendAsyncStep[]>]
[-HttpPipelinePrepend <SendAsyncStep[]>]
[-Proxy <uri>]
[-ProxyCredential <pscredential>]
[-ProxyUseDefaultCredentials]
[-PageSize <int>]
[-All]
[-CountVariable <string>]
[<CommonParameters>]

Example to retrieve all directory roles currently available in Microsoft Entra ID

Example query:

Get-MgDirectoryRole

Example output:

Id: a1b2c3d4-5678-90ab-cdef-111213141516
DisplayName: Global Administrator
RoleTemplateId: 62e90394-69f5-4237-9190-012177145e10
Id: f9e8d7c6-5432-10ab-cdef-171615141312
DisplayName: User Administrator
RoleTemplateId: fe930be7-5e62-47db-91af-98c3a49a38b1
Id: 12345678-abcd-90ef-1234-567890abcdef
DisplayName: Security Administrator
RoleTemplateId: 194ae4cb-b126-40b2-bd5b-6091b380977d
  • Id: The unique identifier of the role instance.
  • DisplayName: The name of the role, such as Global Administrator or User Administrator.
  • RoleTemplateId: The base template used to create that role.

Take control of Microsoft 365 management and reporting with ADManager Plus

ADManager Plus helps you manage users, groups, and access quickly from a single, centralized interface.

Delegation and workflows

Assign daily admin tasks safely with role-based delegation. Teams can manage users and groups while you retain oversight and control.

Automation

Automate repetitive tasks like user provisioning, group updates, and license management. Save time while ensuring consistent, reliable processes.

User and group management

Create and modify users and groups individually or in bulk, making sure the right people have access while avoiding orphaned accounts or unused groups.

Bulk group updates

Easily modify multiple groups at once. Adjust memberships, tweak settings, or reorganize groups to keep up with changing business needs.

Detailed reporting

Choose from over 200 prebuilt reports covering group memberships, license usage, and user activity. Gain full visibility to support audits, monitor access patterns, and spot anomalies.

Access reviews

Conduct regular access reviews to remove unnecessary privileges, retire outdated memberships, and maintain least-privilege access across your tenant.

Important tips

  • Follow the principle of least privilege

    When reviewing directory roles, make sure each user or group has only what they need. Assign roles at the narrowest scope possible. Prefer administrative units or resource-specific scopes over tenant-wide roles to minimize risk.

  • Use built-in and custom roles wisely

    Start by evaluating built-in roles and use them whenever they meet your requirements. Create custom roles only when a built-in role doesn't fit. This keeps role management simpler and helps prevent accidental over-provisioning.

  • Automate and audit role management

    Leverage automation and regular access reviews to assign, revoke, and monitor directory roles. Scheduled audits and automated reports help you spot stale, unnecessary, or over-privileged roles, keeping your environment secure and compliant.

  • Limit privileged role assignments

    Microsoft recommends keeping the total number of privileged role assignments in a tenant to around 60. Following this guidance helps maintain a secure and manageable environment, thereby reducing attack surface and improving governance.

Monitor, manage, and secure Microsoft 365 smarter with ADManager Plus

The one-stop solution to Active Directory Management and Reporting
Email Download Link Email the ADManager Plus download link