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
Get Directory roles which assigned to users (Eligible or active both)
VJ
25
Reputation points
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