Get-EntraServicePrincipalAppRoleAssignment
Obtient une attribution de rôle d’application de principal de service.
Syntaxe
Default (Par défaut)
Get-EntraServicePrincipalAppRoleAssignment
-ServicePrincipalId <String>
[-All]
[-Top <Int32>]
[-Property <String[]>]
[<CommonParameters>]
Description
L’applet Get-EntraServicePrincipalAppRoleAssignment de commande obtient une attribution de rôle pour une application de principal de service dans Microsoft Entra ID.
Pour les scénarios délégués, l’utilisateur appelant a besoin d’au moins l’un des rôles Microsoft Entra suivants.
- Comptes de synchronisation d’annuaires
- Éditeur de répertoires
- Administrateur d’identité hybride
- Administrateur de la Gouvernance de l'Identité
- Administrateur de rôle privilégié
- Administrateur d’utilisateurs
- Administrateur d’application
- Administrateur d’applications cloud
Exemples
Exemple 1 : Récupérer les attributions de rôles d’application pour un principal de service
Connect-Entra -Scopes 'Application.Read.All'
$servicePrincipal = Get-EntraServicePrincipal -Filter "displayName eq 'Helpdesk Application'"
Get-EntraServicePrincipalAppRoleAssignment -ServicePrincipalId $servicePrincipal.Id
DeletedDateTime Id AppRoleId CreatedDateTime PrincipalDisplayName PrincipalId PrincipalType ResourceDisplayName
--------------- -- --------- --------------- -------------------- ----------- ------------- -------------------
2bbbbbb2-3cc3-4dd4-5ee5-6ffffffffff6 00000000-0000-0000-0000-000000000000 29-02-2024 05:53:00 Ask HR aaaaaaaa-bbbb-cccc-1111-222222222222 Group M365 License Manager
Cette commande obtient les attributions de rôles d’application pour le principal de service spécifié.
La première commande obtient l’ID d’un principal de service à l’aide de l’applet de commande Get-EntraServicePrincipal (./Get-EntraServicePrincipal.md). La commande stocke l’ID dans la variable $ServicePrincipalId.
La deuxième commande obtient les attributions de rôles d’application pour le principal de service identifié par $ServicePrincipalId.
Exemple 2 : Récupérer toutes les attributions de rôles d’application pour un principal de service
Connect-Entra -Scopes 'Application.Read.All'
$servicePrincipal = Get-EntraServicePrincipal -Filter "displayName eq 'Helpdesk Application'"
Get-EntraServicePrincipalAppRoleAssignment -ServicePrincipalId $servicePrincipal.Id -All
DeletedDateTime Id AppRoleId CreatedDateTime PrincipalDisplayName PrincipalId
--------------- -- --------- --------------- -------------------- -----------
1aaaaaa1-2bb2-3cc3-4dd4-5eeeeeeeeee5 00000000-0000-0000-0000-000000000000 20/10/2023 17:03:41 Entra-App-Testing aaaaaaaa-bbbb-cccc-1111-222222222222
2bbbbbb2-3cc3-4dd4-5ee5-6ffffffffff6 00000000-0000-0000-0000-000000000000 20/10/2023 17:03:38 Entra-App-Testing aaaaaaaa-bbbb-cccc-1111-222222222222
3cccccc3-4dd4-5ee5-6ff6-7aaaaaaaaaa7 00000000-0000-0000-0000-000000000000 20/10/2023 17:03:37 Entra-App-Testing aaaaaaaa-bbbb-cccc-1111-222222222222
4dddddd4-5ee5-6ff6-7aa7-8bbbbbbbbbb8 00000000-0000-0000-0000-000000000000 20/10/2023 17:03:39 Entra-App-Testing aaaaaaaa-bbbb-cccc-1111-222222222222
5eeeeee5-6ff6-7aa7-8bb8-9cccccccccc9 00000000-0000-0000-0000-000000000000 20/10/2023 17:03:39 Entra-App-Testing aaaaaaaa-bbbb-cccc-1111-222222222222
Cette commande obtient toutes les attributions de rôles d’application pour le principal de service spécifié.
Exemple 3 : Récupérer les cinq premières attributions de rôle d’application pour un principal de service
Connect-Entra -Scopes 'Application.Read.All'
$servicePrincipal = Get-EntraServicePrincipal -Filter "displayName eq 'Helpdesk Application'"
Get-EntraServicePrincipalAppRoleAssignment -ServicePrincipalId $servicePrincipal.Id -Top 3
DeletedDateTime Id AppRoleId CreatedDateTime PrincipalDisplayName PrincipalId
--------------- -- --------- --------------- -------------------- -----------
1aaaaaa1-2bb2-3cc3-4dd4-5eeeeeeeeee5 00000000-0000-0000-0000-000000000000 20/10/2023 17:03:41 Entra-App-Testing aaaaaaaa-bbbb-cccc-1111-222222222222
2bbbbbb2-3cc3-4dd4-5ee5-6ffffffffff6 00000000-0000-0000-0000-000000000000 20/10/2023 17:03:38 Entra-App-Testing aaaaaaaa-bbbb-cccc-1111-222222222222
3cccccc3-4dd4-5ee5-6ff6-7aaaaaaaaaa7 00000000-0000-0000-0000-000000000000 20/10/2023 17:03:37 Entra-App-Testing aaaaaaaa-bbbb-cccc-1111-222222222222
Cette commande obtient trois attributions de rôles d’application pour le principal de service spécifié. Vous pouvez utiliser -Limit comme alias pour -Top.
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 |
-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 |
-ServicePrincipalId
Spécifie l’ID d’un principal de service 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
(All)
| Position: | Named |
| Obligatoire: | True |
| Valeur du pipeline: | True |
| Valeur du pipeline par nom de propriété: | True |
| Valeur des arguments restants: | False |
-Top
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
(All)
| 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.
Notes
Get-EntraServiceAppRoleAssignment est un alias pour Get-EntraServicePrincipalAppRoleAssignment.