Get Directory roles which assigned to users (Eligible or active both)

VJ 25 Reputation points
2025-01-10T09:20:54.9333333+00:00

Hi,
I am working on to collect details of directory roles which are assigned on user and get that details by powershell cli and mggraph api.

I have "Get-MgUserTransitiveMemberOfAsDirectoryRole -UserId " but that is providing me only roles which has starting date, so looking for command to get all directory roles details by user id in powershell.

please provide solution if anyone has.
please let me know if need any clarification.
thank you
VJ

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,753 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,794 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,726 questions
Microsoft Entra Private Access
Microsoft Entra Private Access
Microsoft Entra Private Access provides secure and deep identity-aware, Zero Trust network access to all private apps and resources.
74 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,807 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 111.6K Reputation points MVP
    2025-01-10T16:21:28.4033333+00:00

    There is no single cmdlet you can use for that, you have to combine data from few different methods. I have a ready to use script here, give it a try: https://www.michev.info/blog/post/5958/reporting-on-entra-id-directory-role-assignments-including-pim

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.