Tuesday, 24 April 2018

Get List of Registered Azure AD Applications using PowerShell

In this post, I am going to share powershell script to find and retrieve the list of Azure AD applications that are registered by your company in current tenant. We can use the Get-AzureADApplication cmdlet to fetch all the registered apps.

Before proceed install Azure Active Directory PowerShell for Graph and run the below command to connect Azure AD PowerShell module:
Run the following command to list all the applications that are registered by your company. This command returns both web applications and native applications (run in desktop/mobile device).
Get-AzureADApplication -All:$true
Note: The above command list only applications that are registered in your own tenant directory through App registrations. If you want to retrieve all integrated applications (Enterprise Applications) that are consumed in your tenant, but registered in other company tenants (or in your own tenant), then you have to use another cmdlet Get-AzureADServicePrincipal.
Get-AzureADServicePrincipal -All:$true | ? {$_.Tags -eq "WindowsAzureActiveDirectoryIntegratedApp"}
You can filter the results by application display name.
Get-AzureADApplication -Filter "DisplayName eq 'TestAppName'"
You can also filter the results by application id.
Get-AzureADApplication -Filter "AppId eq 'ca066717-5ded-411b-879e-741de0880978'"

Find and list only Web applications :

Use the below command to get all azure ad applications with the application type "Web app/API"
Get-AzureADApplication -All:$true | Where-Object { $_.PublicClient -ne $true } | FT

Find and list Native applications alone :

Run the following command to get all the native client (desktop/mobile device) applications.
Get-AzureADApplication -All:$true | Where-Object { $_.PublicClient -eq $true } | FT

Export All Registered Azure AD Application Details to CSV :

The below command exports all the all azure ad apps with required details to csv file.
Get-AzureADApplication -All:$true |
Select-Object DisplayName, AppID, PublicClient, AvailableToOtherTenants, HomePage, LogoutUrl  |
Export-Csv "C:\AzureADApps.csv"  -NoTypeInformation -Encoding UTF8


No comments:

Post a Comment