Get-EntraServicePrincipalKeyCredential

取得服務負責人的關鍵憑證。

語法

Default (預設值)

Get-EntraServicePrincipalKeyCredential

    -ServicePrincipalId <String>
    [<CommonParameters>]

Description

指令Get-EntraServicePrincipalKeyCredential長會取得 Microsoft Entra ID 中服務主體的金鑰憑證。

範例

範例 1:取得服務主體的金鑰憑證

Connect-Entra -Scopes 'Application.Read.All'
$servicePrincipal = Get-EntraServicePrincipal -Filter "displayName eq 'Helpdesk Application'"
Get-EntraServicePrincipalKeyCredential -ServicePrincipalId $servicePrincipal.Id
CustomKeyIdentifier DisplayName EndDateTime         Key KeyId                                StartDateTime       Type      Usage
------------------- ----------- -----------         --- -----                                -------------       ----      -----
                                08-02-2025 09:57:08     68b45e27-fef8-4f0d-bc7a-76bd949c16d1 08-02-2024 09:57:08 Symmetric Sign

此範例取得 Microsoft Entra ID 中指定服務主體的金鑰憑證。 你可以用這個指令 Get-EntraServicePrincipal 取得服務主體物件 ID。

  • -ServicePrincipalId 參數指定服務主體 Id。

參數

-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。