Get-EntraApplication
Obtient une application.
Syntaxe
GetQuery (Par défaut)
Get-EntraApplication
[-Filter <String>]
[-All]
[-Top <Int32>]
[-Property <String[]>]
[<CommonParameters>]
GetByValue
Get-EntraApplication
[-SearchString <String>]
[-All]
[-Property <String[]>]
[<CommonParameters>]
GetById
Get-EntraApplication
-ApplicationId <String>
[-Property <String[]>]
[-All]
[<CommonParameters>]
Description
L’applet Get-EntraApplication de commande obtient une application Microsoft Entra ID.
Exemples
Exemple 1 : Obtenir une application par ApplicationId
Connect-Entra -Scopes 'Application.Read.All'
Get-EntraApplication -ApplicationId 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb'
DisplayName Id AppId SignInAudience PublisherDomain
----------- -- ----- -------------- ---------------
ToGraph_443democc3c aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb bbbbbbbb-1111-2222-3333-cccccccccccc AzureADMyOrg contoso.com
Cet exemple montre comment récupérer une application spécifique en fournissant l’ID.
Exemple 2 : Obtenir toutes les applications
Connect-Entra -Scopes 'Application.Read.All'
Get-EntraApplication -All
DisplayName Id AppId SignInAudience PublisherDomain
----------- -- ----- -------------- ---------------
test app aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb bbbbbbbb-1111-2222-3333-cccccccccccc AzureADandPersonalMicrosoftAccount contoso.com
ToGraph_443DEM cccccccc-4444-5555-6666-dddddddddddd dddddddd-5555-6666-7777-eeeeeeeeeeee AzureADMyOrg contoso.com
test adms eeeeeeee-6666-7777-8888-ffffffffffff ffffffff-7777-8888-9999-gggggggggggg AzureADandPersonalMicrosoftAccount contoso.com
test adms app azure gggggggg-8888-9999-aaaa-hhhhhhhhhhhh hhhhhhhh-9999-aaaa-bbbb-iiiiiiiiiiii AzureADandPersonalMicrosoftAccount contoso.com
test adms2 iiiiiiii-aaaa-bbbb-cccc-jjjjjjjjjjjj jjjjjjjj-bbbb-cccc-dddd-kkkkkkkkkkkk AzureADandPersonalMicrosoftAccount contoso.com
Cet exemple montre comment obtenir toutes les applications à partir de Microsoft Entra ID.
Exemple 3 : Obtenir toutes les applications sans propriétaires (applications sans propriétaire)
Connect-Entra -Scopes 'Application.Read.All'
$apps = Get-EntraApplication -All
$appsWithoutOwners = @()
foreach ($app in $apps) {
try {
$owners = Get-EntraApplicationOwner -ApplicationId $app.Id
if (-not $owners) {
$appsWithoutOwners += $app
}
}
catch {
Write-Warning "Failed to check owners for app: $($app.DisplayName)"
}
# Optional: throttle to avoid rate limits (especially in large tenants)
#Start-Sleep -Milliseconds 100
}
$appsWithoutOwners | Select-Object DisplayName, Id, AppId
DisplayName Id AppId
----------- -- -----
Contoso HR App aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb bbbbbbbb-1111-2222-3333-cccccccccccc
Contoso Helpdesk App cccccccc-4444-5555-6666-dddddddddddd dddddddd-5555-6666-7777-eeeeeeeeeeee
Contoso Helpdesk App eeeeeeee-6666-7777-8888-ffffffffffff hhhhhhhh-9999-aaaa-bbbb-iiiiiiiiiiii
Cet exemple montre comment obtenir toutes les applications sans propriétaires de Microsoft Entra ID.
Exemple 4 : Obtenir des applications avec des secrets arrivant à expiration en 30 jours
$expirationThreshold = (Get-Date).AddDays(30)
$appsWithExpiringPasswords = Get-EntraApplication -All | Where-Object { $_.PasswordCredentials } |
ForEach-Object {
$app = $_
$app.PasswordCredentials | Where-Object { $_.EndDate -le $expirationThreshold } |
ForEach-Object {
[PSCustomObject]@{
DisplayName = $app.DisplayName
AppId = $app.AppId
SecretDisplayName = $_.DisplayName
KeyId = $_.KeyId
ExpiringSecret = $_.EndDate
}
}
}
$appsWithExpiringPasswords | Format-Table DisplayName, AppId, SecretDisplayName, KeyId, ExpiringSecret -AutoSize
DisplayName AppId SecretDisplayName KeyId ExpiringSecret
----------- ----- ----------------- ----- --------------
Helpdesk Application dddddddd-5555-6666-7777-eeeeeeeeeeee Helpdesk Password aaaaaaaa-0b0b-1c1c-2d2d-333333333333 11/18/2024
Cet exemple récupère les applications avec des secrets arrivant à expiration dans les 30 jours.
Exemple 5 : Obtenir des applications avec des certificats arrivant à expiration en 30 jours
$expirationThreshold = (Get-Date).AddDays(30)
$appsWithExpiringKeys = Get-EntraApplication -All | Where-Object { $_.KeyCredentials } |
ForEach-Object {
$app = $_
$app.KeyCredentials | Where-Object { $_.EndDate -le $expirationThreshold } |
ForEach-Object {
[PSCustomObject]@{
DisplayName = $app.DisplayName
AppId = $app.AppId
CertificateDisplayName = $_.DisplayName
KeyId = $_.KeyId
ExpiringKeys = $_.EndDate
}
}
}
$appsWithExpiringKeys | Format-Table DisplayName, AppId, CertificateDisplayName, KeyId, ExpiringKeys -AutoSize
DisplayName AppId CertificateDisplayName KeyId ExpiringKeys
----------- ----- ---------------------- ----- ------------
Helpdesk Application dddddddd-5555-6666-7777-eeeeeeeeeeee My cert aaaaaaaa-0b0b-1c1c-2d2d-333333333333 6/27/2024 11:49:17 AM
Cet exemple récupère les applications avec des certificats arrivant à expiration dans les 30 jours.
Exemple 6 : Obtenir une application par nom complet
Connect-Entra -Scopes 'Application.Read.All'
Get-EntraApplication -Filter "DisplayName eq 'ToGraph_443DEMO'"
DisplayName Id AppId SignInAudience PublisherDomain
----------- -- ----- -------------- ---------------
ToGraph_443DEMO cccccccc-4444-5555-6666-dddddddddddd dddddddd-5555-6666-7777-eeeeeeeeeeee AzureADMyOrg contoso.com
Dans cet exemple, nous récupérons l’application par son nom complet à partir de Microsoft Entra ID.
Exemple 7 : Rechercher parmi les applications récupérées
Connect-Entra -Scopes 'Application.Read.All'
Get-EntraApplication -SearchString 'My new application 2'
DisplayName Id AppId SignInAudience PublisherDomain
----------- -- ----- -------------- ---------------
My new application 2 kkkkkkkk-cccc-dddd-eeee-llllllllllll llllllll-dddd-eeee-ffff-mmmmmmmmmmmm AzureADandPersonalMicrosoftAccount contoso.com
Cet exemple montre comment récupérer des applications pour une chaîne spécifique à partir de Microsoft Entra ID.
Exemple 8 : Récupérer une application par identifierUris
Connect-Entra -Scopes 'Application.Read.All'
Get-EntraApplication -Filter "identifierUris/any(uri:uri eq 'https://wingtips.wingtiptoysonline.com')"
Cet exemple montre comment récupérer des applications par son identificateurUris à partir de Microsoft Entra ID.
Exemple 9 : Répertorier les 2 premières applications
Connect-Entra -Scopes 'Application.Read.All'
Get-EntraApplication -Top 2
DisplayName Id AppId SignInAudience PublisherDomain
----------- -- ----- -------------- ---------------
test app aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb bbbbbbbb-1111-2222-3333-cccccccccccc AzureADandPersonalMicrosoftAccount contoso.com
ToGraph_443DEM cccccccc-4444-5555-6666-dddddddddddd dddddddd-5555-6666-7777-eeeeeeeeeeee AzureADMyOrg contoso.com
Cet exemple montre comment récupérer deux applications. Vous pouvez utiliser -Limit comme alias pour -Top.
Exemple 10 : Répertorier les rôles d’application
Connect-Entra -Scopes 'Application.Read.All'
$application = Get-EntraApplication -SearchString 'Contoso Helpdesk Application'
$application.AppRoles | Format-Table -AutoSize
AllowedMemberTypes Description DisplayName Id IsEnabled Origin Value
------------------ ----------- ----------- -- --------- ------ -----
{User, Application} General All General All gggggggg-6666-7777-8888-hhhhhhhhhhhh True Application Survey.Read
{Application} General App Only General Apponly hhhhhhhh-7777-8888-9999-iiiiiiiiiiii True Application Task.Write
{User} General role General bbbbbbbb-1111-2222-3333-cccccccccccc True Application General
Cet exemple montre comment récupérer des rôles d’application pour une application.
Exemple 11 : Répertorier l’application oauth2PermissionScopes (autorisations déléguées exposées par l’application)
Connect-Entra -Scopes 'Application.Read.All'
(Get-EntraApplication -Filter "displayName eq 'Contoso Helpdesk Application'").Api.Oauth2PermissionScopes
AdminConsentDescription : Allows the app to read HR data on behalf of users.
AdminConsentDisplayName : Read HR Data
Id : bbbbbbbb-1111-2222-3333-cccccccccccc
IsEnabled : True
Origin :
Type : User
UserConsentDescription : Allows the app to read your HR data.
UserConsentDisplayName : Read your HR data
Value : HR.Read.All
Cet exemple montre comment récupérer (c’est-à-dire, les oauth2PermissionScopes autorisations déléguées exposées par l’application) à un principal de service. Ces étendues font partie de l’objet d’application.
Exemple 12 : Répertorier les applications et leurs détails de secret
Connect-Entra -Scopes 'Application.Read.All'
Get-EntraApplication -All -Property displayName, appId, passwordCredentials |
Where-Object { $_.PasswordCredentials } |
ForEach-Object {
$app = $_
foreach ($cred in $app.PasswordCredentials) {
[PSCustomObject]@{
DisplayName = $app.DisplayName
AppId = $app.AppId
PasswordCredentialsDisplayName = $cred.DisplayName
PasswordCredentialStartDate = $cred.StartDate
PasswordCredentialEndDate = $cred.EndDate
}
}
} |
Format-Table -AutoSize
DisplayName AppId PasswordCredentialsDisplayName PasswordCredentialStartDate PasswordCredentialEndDate
----------- ----- ------------------------------ --------------------------- -------------------------
Helpdesk Application gggggggg-6666-7777-8888-hhhhhhhhhhhh Helpdesk Application Password 8/20/2024 7:54:25 AM 11/18/2024 7:54:25 AM
Helpdesk Application gggggggg-6666-7777-8888-hhhhhhhhhhhh Helpdesk Application Backend 8/7/2024 4:36:49 PM 2/3/2025 4:36:49 PM
Contoso Automation App bbbbbbbb-1111-2222-3333-cccccccccccc AI automation Cred 5/3/2025 7:03:11 PM 5/3/2026 7:03:11 PM
Cet exemple montre comment récupérer des applications qui ont des secrets.
Paramètres
-All
Répertorier toutes les pages.
Propriétés du paramètre
| Type: | System.Management.Automation.SwitchParameter |
| Valeur par défaut: | False |
| Prend en charge les caractères génériques: | False |
| DontShow: | False |
Jeux de paramètres
(All)
| Position: | Named |
| Obligatoire: | False |
| Valeur du pipeline: | False |
| Valeur du pipeline par nom de propriété: | False |
| Valeur des arguments restants: | False |
-ApplicationId
Spécifie l’ID d’une application dans Microsoft Entra ID.
Propriétés du paramètre
| Type: | System.String |
| Valeur par défaut: | None |
| Prend en charge les caractères génériques: | False |
| DontShow: | False |
| Alias: | Identifiant d'objet (ObjectId) |
Jeux de paramètres
GetById
| Position: | Named |
| Obligatoire: | True |
| Valeur du pipeline: | True |
| Valeur du pipeline par nom de propriété: | True |
| Valeur des arguments restants: | False |
-Filter
Spécifie une instruction de filtre OData v4.0. Ce paramètre contrôle les objets retournés.
Propriétés du paramètre
| Type: | System.String |
| Valeur par défaut: | None |
| Prend en charge les caractères génériques: | False |
| DontShow: | False |
Jeux de paramètres
GetQuery
| Position: | Named |
| Obligatoire: | False |
| Valeur du pipeline: | True |
| Valeur du pipeline par nom de propriété: | True |
| Valeur des arguments restants: | False |
-Property
Spécifie les propriétés à retourner
Propriétés du paramètre
| Type: | System.String[] |
| Valeur par défaut: | None |
| Prend en charge les caractères génériques: | False |
| DontShow: | False |
| Alias: | Sélectionnez |
Jeux de paramètres
(All)
| Position: | Named |
| Obligatoire: | False |
| Valeur du pipeline: | False |
| Valeur du pipeline par nom de propriété: | False |
| Valeur des arguments restants: | False |
-SearchString
Spécifie une chaîne de recherche.
Propriétés du paramètre
| Type: | System.String |
| Valeur par défaut: | None |
| Prend en charge les caractères génériques: | False |
| DontShow: | False |
Jeux de paramètres
GetVague
| Position: | Named |
| Obligatoire: | False |
| Valeur du pipeline: | True |
| Valeur du pipeline par nom de propriété: | True |
| Valeur des arguments restants: | False |
-Top
Spécifie le nombre maximal d’enregistrements à retourner.
Propriétés du paramètre
| Type: | System.Int32 |
| Valeur par défaut: | None |
| Prend en charge les caractères génériques: | False |
| DontShow: | False |
| Alias: | Limite |
Jeux de paramètres
GetQuery
| Position: | Named |
| Obligatoire: | False |
| Valeur du pipeline: | True |
| Valeur du pipeline par nom de propriété: | True |
| Valeur des arguments restants: | False |
CommonParameters
Cette applet de commande prend en charge les paramètres courants : -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction et -WarningVariable. Pour plus d’informations, consultez about_CommonParameters.