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

Girish Prajwal 651 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.

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
14,652 questions
{count} votes

Accepted answer
  1. soumi-MSFT 11,651 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

0 additional answers

Sort by: Most helpful