Remove-EntraServicePrincipalOwner

Removes an owner from a service principal.

Syntax

Remove-EntraServicePrincipalOwner
      -OwnerId <String>
      -ServicePrincipalId <String>
      [<CommonParameters>]

Description

The Remove-EntraServicePrincipalOwner cmdlet removes an owner from a service principal in Microsoft Entra ID.

Examples

Example 1: Removes an owner from a service principal

Connect-Entra -Scopes 'Application.ReadWrite.All'
$servicePrincipal = Get-EntraServicePrincipal -Filter "DisplayName eq '<ServicePrincipal-DisplayName>'"
$owner = Get-EntraUser -UserId 'SawyerM@contoso.com'

$params= @{
    ServicePrincipalId = $servicePrincipal.Id 
    OwnerId = $owner.Id
}
Remove-EntraServicePrincipalOwner @params

This example demonstrates how to remove an owner from a service principal in Microsoft Entra ID.

  • -ServicePrincipalId parameter specifies the service principal Id.
  • -OwnerId parameter specifies the service principal owner Id.

Parameters

-OwnerId

Specifies the ID of the owner.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ServicePrincipalId

Specifies the ID of a service principal.

Type:System.String
Aliases:ObjectId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False