Get-EntraServicePrincipalOwner
Obtenez le propriétaire d’un principal de service.
Syntaxe
GetQuery (Par défaut)
Get-EntraServicePrincipalOwner
-ServicePrincipalId <String>
[-All]
[-Top <Int32>]
[-Property <String[]>]
[<CommonParameters>]
Append
Get-EntraServicePrincipalOwner
-ServicePrincipalId <String>
-Property <String[]>
-AppendSelected
[-Top <Int32>]
[-All]
[<CommonParameters>]
Description
L’applet Get-EntraServicePrincipalOwner de commande obtient les propriétaires d’un principal de service dans Microsoft Entra ID.
Exemples
Exemple 1 : Récupérer le propriétaire d’un principal de service
Connect-Entra -Scopes 'Application.Read.All'
$servicePrincipal = Get-EntraServicePrincipal -Filter "displayName eq 'Helpdesk Application'"
Get-EntraServicePrincipalOwner -ServicePrincipalId $servicePrincipal.Id | Select-Object Id, userPrincipalName, DisplayName, '@odata.type'
Id userPrincipalName displayName @odata.type
-- ----------------- ----------- -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb AlexW@Contoso.com Alex Wilber #microsoft.graph.user
bbbbbbbb-1111-2222-3333-cccccccccccc ChristieC@Contoso.com Christie Cline #microsoft.graph.user
Cet exemple obtient les propriétaires d’un principal de service spécifié. Vous pouvez utiliser la commande Get-EntraServicePrincipal pour obtenir l’ID d’objet du principal de service.
-
-ServicePrincipalIdspécifie l’identificateur unique d’un principal de service.
Exemple 2 : Récupérer tous les propriétaires d’un principal de service
Connect-Entra -Scopes 'Application.Read.All'
$servicePrincipal = Get-EntraServicePrincipal -Filter "displayName eq 'Helpdesk Application'"
Get-EntraServicePrincipalOwner -ServicePrincipalId $servicePrincipal.Id -All | Select-Object Id, userPrincipalName, DisplayName, '@odata.type'
Id userPrincipalName displayName @odata.type
-- ----------------- ----------- -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb AlexW@Contoso.com Alex Wilber #microsoft.graph.user
bbbbbbbb-1111-2222-3333-cccccccccccc ChristieC@Contoso.com Christie Cline #microsoft.graph.user
Cette commande obtient tous les propriétaires d’un principal de service. Vous pouvez utiliser la commande Get-EntraServicePrincipal pour obtenir l’ID d’objet du principal de service.
-
-ServicePrincipalIdspécifie l’identificateur unique d’un principal de service.
Exemple 3 : Récupérer les deux principaux propriétaires d’un principal de service
Connect-Entra -Scopes 'Application.Read.All'
$servicePrincipal = Get-EntraServicePrincipal -Filter "displayName eq 'Helpdesk Application'"
Get-EntraServicePrincipalOwner -ServicePrincipalId $servicePrincipal.Id -Top 2 | Select-Object Id, userPrincipalName, DisplayName, '@odata.type'
Id userPrincipalName displayName @odata.type
-- ----------------- ----------- -----------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb AlexW@Contoso.com Alex Wilber #microsoft.graph.user
bbbbbbbb-1111-2222-3333-cccccccccccc ChristieC@Contoso.com Christie Cline #microsoft.graph.user
Cette commande obtient les deux principaux propriétaires d’un principal de service. Vous pouvez utiliser la commande Get-EntraServicePrincipal pour obtenir l’ID d’objet du principal de service. Vous pouvez utiliser -Limit comme alias pour -Top.
-
-ServicePrincipalIdspécifie l’identificateur unique d’un principal de service.
Exemple 4 : Récupérer les deux principaux propriétaires d’un principal de service et sélectionner et ajouter une propriété non retournée par défaut.
Connect-Entra -Scopes 'Application.Read.All'
$servicePrincipal = Get-EntraServicePrincipal -Filter "displayName eq 'Helpdesk Application'"
Get-EntraServicePrincipalOwner -ServicePrincipalId 0a40f8f8-4e30-4f58-bf26-772ad69f41f6 -Property userType -AppendSelected -Top 2 | Select-Object Id, userPrincipalName, DisplayName, '@odata.type', userType
Id displayName @odata.type userType
-- ----------- ----------- ---------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Alex Wilber #microsoft.graph.user Member
bbbbbbbb-1111-2222-3333-cccccccccccc Christie Cline #microsoft.graph.user Member
Cette commande obtient les deux principaux propriétaires d’un principal de service. Vous pouvez utiliser la commande Get-EntraServicePrincipal pour obtenir l’ID d’objet du principal de service. Vous pouvez utiliser -Limit comme alias pour -Top.
-
-ServicePrincipalIdspécifie l’identificateur unique d’un principal de service. -
-Propertyle paramètre sélectionne une propriétéuserTypequi n’est pas retournée par défaut. -
-AppendSelectedle paramètre garantit que la propriété sélectionnée est retournée avec les propriétés par défaut.
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 |
-AppendSelected
Spécifie s’il faut ajouter les propriétés sélectionnées.
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
Append
| 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
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
(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.