powershell export enterprise apps and users\groups assigned

Skip Hofmann 186 Reputation points
2022-01-13T22:10:09.95+00:00

Hello

Looking for help on how to use a powershell script to export a list of enterprise apps in Azure along with the users\groups that have been assigned to the application

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

1 answer

Sort by: Most helpful
  1. JamesTran-MSFT 36,461 Reputation points Microsoft Employee
    2022-01-13T22:50:31.803+00:00

    @Skip Hofmann
    Thank you for your post!

    You should be able to use the following PS script to get the enterprise apps and users\groups assigned.

     $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  
     }  
    

    Related Issues:
    How to export Users from Azure Enterprise Applications either from Portal/Powershell
    The best way to pull a list of all apps from Azure AD with "Users or groups" they may have
    Is there a way to use PowerShell to list all users and groups that's been assigned to specific Enterprise Application

    If you have any other questions, please let me know.
    Thank you for your time and patience throughout this issue.

    ----------

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    6 people found this answer helpful.