Remove-EntraServicePrincipalPasswordCredential

移除服務主體的密碼憑證。

語法

Default (預設值)

Remove-EntraServicePrincipalPasswordCredential

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

Description

該Remove-EntraServicePrincipalPasswordCredential指令檔會從 Microsoft Entra ID 中的服務主體移除密碼憑證。

範例

範例 1:移除 Microsoft Entra ID 中服務主體的密碼憑證

Connect-Entra -Scopes 'Application.ReadWrite.All','Application.ReadWrite.OwnedBy'
$servicePrincipal = Get-EntraServicePrincipal -Filter "displayName eq 'Helpdesk Application'"
$key = Get-EntraServicePrincipalPasswordCredential -ServicePrincipalId $servicePrincipal.Id
$key = $key | Where-Object {$_.DisplayName -eq 'Helpdesk secret'}
Remove-EntraServicePrincipalPasswordCredential -ServicePrincipalId $servicePrincipal.Id -KeyId $key.KeyId

此範例示範如何在 Microsoft Entra ID 中移除服務主體的密碼憑證。

  • -ServicePrincipalId 參數指定指定服務主體密碼憑證的 ServicePrincipalId。
  • -KeyId 參數指定密碼憑證的唯一識別碼。

參數

-KeyId

指定密碼憑證的唯一識別碼。

參數屬性

類型:System.String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:True
來自管線的值:True
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-ServicePrincipalId

指定應用程式在 Microsoft Entra ID 中的 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。