共用方式為


檢視憑證

適用於:no-img-13 2013no-img-16 2016no-img-19 2019yes-img-seSubscription Edition no-img-sopSharePoint in Microsoft 365

SharePoint 支援透過 Get-SPCertificate PowerShell Cmdlet 尋找憑證。 選擇性參數可用來篩選此 Cmdlet 所傳回的結果。

Get-SPCertificate [-Identity] <SPServerCertificatePipeBind>
Get-SPCertificate [-DisplayName] <String> [-Thumbprint <String>] [-SerialNumber <String>] [-Store {EndEntity | Intermediate | Pending | Root}] [-InUse] [-DaysToExpiration <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]

Cmdlet 參數為:

參數 描述
[身分識別] 指定要尋找之憑證的顯示名稱、指紋、序號或 GUID。 如果多個憑證符合指定的身分識別,則不會傳回任何憑證。 當多個憑證相符時,請使用選擇性參數的篩選準則。
DisplayName 要尋找之憑證的顯示名稱。 如果多個憑證可能符合此準則,請使用此參數,而不是 Identity 參數。 Identity 參數只能傳回單一憑證。
Thumbprint 要尋找之憑證的指紋,格式為 “1234567890ABCDEF1234567890ABCDEF12345678”。
SerialNumber 要尋找之憑證的序號,格式為 “1234567890ABCDEF1234567890ABCDEF”
Store (EndEntity / Intermediate / Pending / Root) 指定要搜尋的證書存儲。 如果未指定此參數,則會搜尋所有證書存儲。
InUse 指定 只傳回直接指派給 SharePoint 物件的憑證, (目前使用中) 。
DaysToExpiration 如果是正數,則只會傳回憑證,該憑證將在此參數現在指定的天數內過期。 指定 「-1」 只傳回已過期的憑證。 指定 「0」 將不會根據到期日進行篩選。

以下是 Cmdlet 語法的範例:

- Get-SPCertificate -FriendlyName "Contoso SharePoint (2020)"
- Get-SPCertificate -InUse -DaysToExpiration 30