Get all Application Proxy connector groups and connectors in the directory

This PowerShell script example lists all Microsoft Entra application proxy connector groups and connectors in your directory.

If you don't have an Azure subscription, create an Azure free account before you begin.


We recommend that you use the Azure Az PowerShell module to interact with Azure. See Install Azure PowerShell to get started. To learn how to migrate to the Az PowerShell module, see Migrate Azure PowerShell from AzureRM to Az.

Azure Cloud Shell

Azure hosts Azure Cloud Shell, an interactive shell environment that you can use through your browser. You can use either Bash or PowerShell with Cloud Shell to work with Azure services. You can use the Cloud Shell preinstalled commands to run the code in this article, without having to install anything on your local environment.

To start Azure Cloud Shell:

Option Example/Link
Select Try It in the upper-right corner of a code or command block. Selecting Try It doesn't automatically copy the code or command to Cloud Shell. Screenshot that shows an example of Try It for Azure Cloud Shell.
Go to, or select the Launch Cloud Shell button to open Cloud Shell in your browser. Screenshot that shows how to launch Cloud Shell in a new window.
Select the Cloud Shell button on the menu bar at the upper right in the Azure portal. Screenshot that shows the Cloud Shell button in the Azure portal

To use Azure Cloud Shell:

  1. Start Cloud Shell.

  2. Select the Copy button on a code block (or command block) to copy the code or command.

  3. Paste the code or command into the Cloud Shell session by selecting Ctrl+Shift+V on Windows and Linux, or by selecting Cmd+Shift+V on macOS.

  4. Select Enter to run the code or command.

This sample requires the Azure Active Directory PowerShell 2.0 for Graph module or the Azure Active Directory PowerShell 2.0 for Graph module preview version (AzureADPreview).

Sample script

# This sample script gets all Azure AD Application Proxy Connector groups with the included connectors.
# This script requires PowerShell 5.1 (x64) and one of the following modules:
#     AzureAD
#     AzureADPreview
# Before you begin:
#    Run Connect-AzureAD to connect to the tenant domain.
#    Required Azure AD role: Global Administrator or Application Administrator

Write-Host "Reading connector groups. This operation might take longer..." -BackgroundColor "Black" -ForegroundColor "Green"

$aadapConnectorGroups = Get-AzureADApplicationProxyConnectorGroup -Top 100000 

Write-Host "Displaying connector groups and connectors..." -BackgroundColor "Black" -ForegroundColor "Green"
Write-Host " "

foreach ($item in $aadapConnectorGroups) {
     If ($item.ConnectorGroupType -eq "applicationProxy") {

     "Connector group: " + $item.Name, "(Id:" + $item.Id + ")";
     Get-AzureADApplicationProxyConnectorGroupMembers -Id $item.Id;
     " ";


Write-Host ("")
Write-Host ("Finished.") -BackgroundColor "Black" -ForegroundColor "Green"
Write-Host ("") 

Script explanation

Command Notes
Get-AzureADApplicationProxyConnectorGroup Retrieves a list of all connector groups, or if specified, details of the specified connector group.
Get-AzureADApplicationProxyConnectorGroupMembers Gets all Application Proxy connectors associated with each connector group.

Next steps

For more information on the Azure AD PowerShell module, see Azure AD PowerShell module overview.

For other PowerShell examples for Application Proxy, see Azure AD PowerShell examples for Microsoft Entra application proxy.