Remove-EntraServicePrincipalOwner
將業主從服務主體中移除。
語法
Default (預設值)
Remove-EntraServicePrincipalOwner
-OwnerId <String>
-ServicePrincipalId <String>
[<CommonParameters>]
Description
該Remove-EntraServicePrincipalOwner指令檔會移除 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
標明車主的身分證。
參數屬性
| 類型: | System.String |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | Named |
| 必要: | True |
| 來自管線的值: | True |
| 來自管線按屬性名稱的值: | True |
| 來自剩餘引數的值: | False |
-ServicePrincipalId
指定服務主體的識別碼。
參數屬性
| 類型: | 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。