Remove-EntraServicePrincipalOwner

从服务主体中删除所有者。

语法

Default (默认值)

Remove-EntraServicePrincipalOwner

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

说明

该 Remove-EntraServicePrincipalOwner cmdlet 从Microsoft Entra ID中的服务主体中删除所有者。

示例

示例 1:从服务主体中删除所有者

Connect-Entra -Scopes 'Application.ReadWrite.All'
$servicePrincipal = Get-EntraServicePrincipal -Filter "displayName eq 'Helpdesk Application'"
$ownership = Get-EntraServicePrincipalOwner -ServicePrincipalId $servicePrincipal.Id | Select-Object Id, userPrincipalName, DisplayName, '@odata.type'
$owner = $ownership | Where-Object {$_.userPrincipalName -eq 'SawyerM@Contoso.com' }
Remove-EntraServicePrincipalOwner -ServicePrincipalId $servicePrincipal.Id -OwnerId $owner.Id

此示例演示如何从Microsoft Entra ID的服务主体中删除所有者。

  • -ServicePrincipalId 参数指定服务主体 ID。
  • -OwnerId 参数指定服务主体所有者 ID。

参数

-OwnerId

指定所有者的 ID。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ServicePrincipalId

指定服务主体的 ID。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False
别名:对象标识符 (ObjectId)

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。