Forum Discussion
need help on list of Azure entra id groups associated for the appid / registered application
- Aug 15, 2024
Hello againvenkatchandra2024 !
If you run the following instead then you will get the Name of the group or user that is assigned to the application in a nice list 🙂
Connect-MgGraph -Scope "Application.Read.All" $ServicePrincipalId = "<YourEnterpriseAppObjectID>" Get-MgServicePrincipalAppRoleAssignedTo -ServicePrincipalId $ServicePrincipalId | select PrincipalDisplayName, PrincipalTypeSo all you need to edit is the last command. And your output will look like this
Let me know how it goes!
Kind Regards
Oliwer Sundgren
No worries! 🙂 venkatchandra2024
You will need to connect to Graph and not Azure AD.
Try and run the following lines and it should work 🙂
If you get an error that you dont have permissions let me know and I will guide you on how to grant your account the needed accesses
Connect-MgGraph -Scope "Application.Read.All"
$ServicePrincipalId = "<YourEnterpriseAppObjectID>"
Get-MgServicePrincipalAppRoleAssignedTo -ServicePrincipalId $ServicePrincipalId
DeletedDateTime Id AppRoleId CreatedDateTime PrincipalDisplayName PrincipalId PrincipalType
--------------- -- --------- --------------- -------------------- ----------- -------------
- oliwer_sundgrenAug 15, 2024Iron Contributor
Hello againvenkatchandra2024 !
If you run the following instead then you will get the Name of the group or user that is assigned to the application in a nice list 🙂
Connect-MgGraph -Scope "Application.Read.All" $ServicePrincipalId = "<YourEnterpriseAppObjectID>" Get-MgServicePrincipalAppRoleAssignedTo -ServicePrincipalId $ServicePrincipalId | select PrincipalDisplayName, PrincipalTypeSo all you need to edit is the last command. And your output will look like this
Let me know how it goes!
Kind Regards
Oliwer Sundgren- venkatchandra2024Aug 15, 2024Copper ContributorThank you for the response, Can I pass Appname instedy of $ServicePrincipalId = "<YourEnterpriseAppObjectID>"
Connect-MgGraph -Scope "Application.Read.All"
$appName= "<YourEnterpriseAppObjectID>"
Get-MgServicePrincipalAppRoleAssignedTo -ServicePrincipalId $ServicePrincipalId | select PrincipalDisplayName, PrincipalType