How to export Users from Azure Enterprise Applications either from Portal/Powershell

Girish Prajwal 706 Reputation points
2020-10-21T13:55:19.6+00:00

Hi Team,

We have loads of Enterprise applications in our Azure AD and also have users access to the respective applications.
We would like to export all the users from an Enterprise Application. While going through some of the reference forums/articles as below, it is not pointing us to the right direction. Please suggest.

https://github.com/MicrosoftDocs/azure-docs/issues/48159

I even used the AAD Graph API - not much knowledge on the topic. However, I get the 200 OK message. which is a good sign, It doesn't list the users.

Please suggest my options.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,465 questions
{count} vote

Accepted answer
  1. soumi-MSFT 11,716 Reputation points Microsoft Employee
    2020-10-21T19:04:20.527+00:00

    Hello @Girish Prajwal , thank you for reaching out. You can use the following PS script to pull out the details of the assigned users or groups to an Application registered in AAD.

    Connect-AzureAD  
      
    $PathCsv = "C:\temp\EnterpriseApplicationReport.csv"  
    $ServicePrincipalList = Get-AzureADServicePrincipal -All $true  
      
    foreach($servicePrincipal in $ServicePrincipalList){  
        Get-AzureADServiceAppRoleAssignment -ObjectId $ServicePrincipal.objectId | Select-Object ResourceDisplayName, ResourceId, PrincipalDisplayName, PrincipalType | Export-Csv -Path $PathCsv -NoTypeInformation -Append  
    }  
    

    Hope this helps.

    Do let us know if this helps and if there are any more queries around this, please do let us know so that we can help you further. Also, please do not forget to accept the response as an Answer; if the above response helped in answering your query.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Daniel Istrati 0 Reputation points
    2023-08-23T09:18:45.6333333+00:00

    How can this be achieved using Microsoft Graph Powershell (as I am using MacOS)?

    Regards,

    Dani

    0 comments No comments