Skip to main content

SYNOPSIS

Retrieves all Entra ID applications and their assignment types.

SYNTAX

All (Default)

ByApplicationId

ByObjectId

ByDisplayName

DESCRIPTION

This function returns a list of all Entra ID applications with their assignment information, identifying whether they are assigned to all users or have specific assignments. If no assignments exist, it indicates whether the application is available to “all users”. Give information about assigned users, groups, or service principals and if the group is protected/static/dynamic.

EXAMPLES

EXAMPLE 1

Retrieves all applications and their assignment types.

EXAMPLE 2

Uses the Graph JSON $batch endpoint to retrieve the app role assignments (20 requests per HTTP call, automatic 429 retry).

EXAMPLE 3

Forces sequential processing even on PowerShell 7+ (useful for debugging or to avoid concurrent Graph calls).

EXAMPLE 4

Retrieves assignment types for the specified application IDs.

EXAMPLE 5

Retrieves assignment types for the service principal matching this ObjectID.

EXAMPLE 6

Retrieves assignment types for the service principal matching this DisplayName.

EXAMPLE 7

Retrieves only applications with no specific user/group/service principal assignments.

EXAMPLE 8

Gets all applications and exports them to an Excel file

PARAMETERS

-AllApplications

(Optional) If specified, retrieves all service principals regardless of type. By default, only Enterprise Applications (tagged ‘WindowsAzureActiveDirectoryIntegratedApp’) are returned.

-ApplicationId

(Optional) One or more Application IDs (AppId) to filter the results. If not provided, all applications will be processed.

-AssignmentEmpty

(Optional) If specified, only applications with no specific user/group/service principal assignments will be returned. Note: these apps may still be accessible to all users if AppRoleAssignmentRequired is $false.

-AssignmentNotEnforced

(Optional) If specified, only applications where AppRoleAssignmentRequired is $false (open to all users, no assignment needed) will be returned.

-DisableParallel

(Optional) Forces sequential processing. By default, on PowerShell 7+ the function analyzes applications in parallel (ForEach-Object -Parallel) to speed up processing; on PowerShell 5.1 it always runs sequentially.

-DisplayName

(Optional) Display name of a single service principal to target (exact match, with fallback on trimmed comparison). Cannot be combined with -ApplicationId or -ObjectID.

-ExportPath

Optional output directory for the Excel export (defaults to the user profile).

-ExportToExcel

(Optional) If specified, exports the results to an Excel file in the user’s profile directory.

-ObjectID

(Optional) ObjectID (GUID) of a single service principal to target. Cannot be combined with -ApplicationId or -DisplayName.

-ThrottleLimit

(Optional) Maximum number of concurrent runspaces when running in parallel. Default is 5. Keep this value moderate to avoid Microsoft Graph throttling (HTTP 429).

-UseBatchRequest

(Optional) Uses the Microsoft Graph JSON $batch endpoint (via Invoke-MgGraphBatchRequest, 20 requests per HTTP call with automatic HTTP 429 retry) to retrieve the app role assignments, instead of ForEach-Object -Parallel. Requires the PS365 module (Invoke-MgGraphBatchRequest); when the command is not available (e.g. script deployed standalone), the function warns and falls back to the default behavior. Note: the per-principal lookups (user, group, service principal details) are still performed individually.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES