更新 Exchange Server 憑證

適用於:yes-img-162016 yes-img-192019 yes-img-se訂閱版本

每個憑證都會內建到期日期。 在 Exchange Server 中,安裝在 Exchange 伺服器上的預設自我簽署憑證會在伺服器上安裝 Exchange 後 5 年到期。 您可以使用 Exchange 系統管理中心 (EAC) 或 Exchange 管理命令介面來更新 Exchange 憑證。 這包括 Exchange 自我簽署憑證,以及由憑證授權單位 (CA) 所發出的憑證。

注意事項

Exchange 管理員 Center (EAC) 可用於管理 Exchange Server 2019 CU15 和更新版本中的憑證。 對於 Exchange Server 2016 CU23 和 Exchange Server 2019 CU12 到 CU14,請使用 Exchange 管理命令介面 (EMS) 程序。

開始之前有哪些須知?

  • 預估完成時間:5 分鐘

  • 若要了解如何在內部部署 Exchange 組織中開啟 Exchange 管理命令介面,請參閱 Open the Exchange Management Shell。

  • 對於 CA 所發出的憑證,請確認 CA 的憑證要求需求。 Exchange 會產生 PKCS #10 (.req) 要求檔案,此檔案使用的是 Base64 編碼 (預設值) 或可辨別編碼規則 (DER),且其 RSA 公開金鑰為 1024、2048 (預設值) 或 4096 位元。 請注意,Exchange 管理命令介面才會提供編碼和公開金鑰選項。

  • 若要更新由 CA 所發出的憑證,您必須透過發出憑證的同一個 CA 來更新憑證。 如果您要變更 CA,或是原始憑證在嘗試更新時發生問題,則必須建立新的憑證要求 (也稱為憑證簽署要求 (CSR)),以取得新的憑證。 如需詳細資訊,請參閱建立憑證授權單位的 Exchange Server 憑證要求。

  • 如果您在已訂閱的 Edge Transport Server 上更新或取代由 CA 所發出的憑證,您就必須移除舊憑證,然後先刪除再重新建立 Edge 訂閱。 如需詳細資訊,請參閱<Edge 訂閱程序>。

  • 您必須已獲指派權限,才能執行此程序或這些程序。 若要查看您需要哪些權限,請參閱 「用戶端和行動裝置權限 」主題中的「用戶端存取服務安全性」項目。

  • 如需適用於此主題中程序的快速鍵相關資訊,請參閱 Exchange 系統管理中心的鍵盤快速鍵。

提示

有問題嗎? 在 Exchange 的 Exchange Server 論壇中尋求協助 |Exchange Server |管理。

更新由憑證授權單位所發出的憑證

由內部 CA (例如,Active Directory 憑證服務) 或商業 CA 所發出之憑證所使用的程序都相同。

若要更新由 CA 所發出的憑證,您必須建立憑證更新要求,然後將要求傳送給 CA。 接著,CA 會將您必須安裝在 Exchange 伺服器上的實際憑證檔案傳送給您。 此程序與藉由在伺服器上安裝憑證來完成新憑證要求的程序幾乎一致。 如需指示,請參閱完成擱置中的 Exchange Server 憑證要求。

使用 EAC 來對憑證授權單位建立憑證更新要求

  1. 開啟 EAC 並瀏覽至 [ 伺服器>憑證]。

  2. In the Select server list, select the Exchange server that holds the certificate that you want to renew.

  3. All valid certificates have a Renew link in the details pane that's visible when you select the certificate from the list. Select the certificate that you want to renew, and then click Renew in the details pane.

  4. On the Renew Exchange certificate page that opens, in the Save the certificate request to the following file field, enter the UNC path and filename for the new certificate renewal request file. 例如,\\FileServer01\Data\ContosoCertRenewal.req。 完成後,按一下 [確定]。

The certificate request appears in the list of Exchange certificates with a status value of Pending.

使用 Exchange 管理命令介面來對憑證授權單位建立憑證更新要求

若要為憑證授權單位建立新憑證更新要求,請使用下列語法:

  • 如果您需要將憑證更新要求檔案 的內容 傳送至 CA,請使用下列語法建立 Base64 編碼的要求檔案:

    $txtrequest = Get-ExchangeCertificate -Thumbprint <Thumbprint> | New-ExchangeCertificate -GenerateRequest [-KeySize <1024 | 2048 | 4096>] [-Server <ServerIdentity>]
    [System.IO.File]::WriteAllBytes('<FilePathOrUNCPath>\<FileName>.req', [System.Text.Encoding]::Unicode.GetBytes($txtrequest))
    
  • 如果您需要將 憑證更新要求檔案 傳送到 CA,請使用下列語法建立 DER 編碼的要求檔案:

    $binrequest = Get-ExchangeCertificate -Thumbprint <Thumbprint> | New-ExchangeCertificate -GenerateRequest -BinaryEncoded [-KeySize <1024 | 2048 | 4096>] [-Server <ServerIdentity>]
    [System.IO.File]::WriteAllBytes('<FilePathOrUNCPath>\<FileName>.pfx', $binrequest.FileData)
    

若要尋找您要更新之憑證的指紋值,請執行下列命令:

Get-ExchangeCertificate | where {$_.Status -eq "Valid" -and $_.IsSelfSigned -eq $false} | Format-List FriendlyName,Subject,CertificateDomains,Thumbprint,NotBefore,NotAfter

如需詳細的語法和參數資訊,請參閱 Get-ExchangeCertificate 和 New-ExchangeCertificate。

注意:

  • 如果您未使用 KeySize 參數,則憑證要求具有 2048 位元 RSA 公開金鑰。
  • 如果不使用 Server 參數,則命令是在本機 Exchange 伺服器中執行。

此範例會為現有憑證建立 Base64 編碼憑證更新要求,其中包含指紋值 5DB9879E38E36BCB60B761E29794392B23D1C054:

$txtrequest = Get-ExchangeCertificate -Thumbprint 5DB9879E38E36BCB60B761E29794392B23D1C054 | New-ExchangeCertificate -GenerateRequest
[System.IO.File]::WriteAllBytes('\\FileServer01\Data\ContosoCertRenewal.req', [System.Text.Encoding]::Unicode.GetBytes($txtrequest))

此範例會為相同的憑證建立 DER (二進位) 編碼憑證更新要求:

$binrequest = Get-ExchangeCertificate -Thumbprint <Thumbprint> | New-ExchangeCertificate -GenerateRequest -BinaryEncoded
[System.IO.File]::WriteAllBytes('\\FileServer01\Data\ContosoCertRenewal.pfx', $binrequest.FileData)

如何知道您已成功建立憑證更新要求?

若要確認是否已成功對憑證授權單位建立憑證更新要求,請執行下列任一步驟:

  • 在 EAC AT 伺服器>憑證中,確認已選取儲存憑證要求的伺服器。 The request should be in the list of certificates with the Status value Pending request.

  • 在用來儲存憑證要求的伺服器上,於 Exchange 管理命令介面中執行下列命令:

    Get-ExchangeCertificate | where {$_.Status -eq "PendingRequest" -and $_.IsSelfSigned -eq $false} | Format-List FriendlyName,Subject,CertificateDomains,Thumbprint
    

更新 Exchange 自我簽署憑證

當您更新 Exchange 自我簽署憑證時,基本上您是在製作新的憑證。

使用 EAC 來更新 Exchange 自我簽署憑證

  1. 開啟 EAC 並瀏覽至 [ 伺服器>憑證]。

  2. In the Select server list, select the Exchange server that holds the certificate that you want to renew.

  3. All valid certificates have a Renew link in the details pane that's visible when you select the certificate from the list. Select the certificate that you want to renew, and then click Renew in the details pane.

  4. On the Renew Exchange certificate page that opens, verify the read-only list of Exchange services that the existing certificate is assigned to, and then click OK.

使用 Exchange 管理命令介面 來更新 Exchange 自我簽署憑證

若要更新自我簽署憑證,請使用下列語法:

Get-ExchangeCertificate -Thumbprint <Thumbprint> | New-ExchangeCertificate [-Force] [-PrivateKeyExportable <$true | $false>]

若要尋找您要更新之憑證的指紋值,請執行下列命令:

Get-ExchangeCertificate | where {$_.IsSelfSigned -eq $true} | Format-List FriendlyName,Subject,CertificateDomains,Thumbprint,NotBefore,NotAfter

此範例會在本機 Exchange 伺服器上更新自我簽署憑證,並使用下列設定:

  • 要續約的現有自我簽署憑證的指紋值為 BC37CBE2E59566BFF7D01FEAC9B6517841475F2D
  • 強制 參數會在 沒有確認提示的情況下取代原始的自我簽署憑證。
  • 私密金鑰是可匯出的。 這可讓您匯出憑證再匯入到其他伺服器。
Get-ExchangeCertificate -Thumbprint BC37CBE2E59566BFF7D01FEAC9B6517841475F2D | New-ExchangeCertificate -Force -PrivateKeyExportable $true

如何知道您已成功更新 Exchange 自我簽署憑證?

若要確認是否已成功更新 Exchange 自我簽署憑證,請使用下列任一程序:

  • 在 EAC AT 伺服器>憑證中,確認已選取安裝憑證的伺服器。 In the list of certificates, verify that the certificate has Status property value Valid.

  • 在更新了自我簽署憑證的伺服器上,於 Exchange 管理命令介面中執行下列命令,以確認屬性值:

Get-ExchangeCertificate | where {$_.Status -eq "Valid" -and $_.IsSelfSigned -eq $true} | Format-List FriendlyName,Subject,CertificateDomains,Thumbprint,NotBefore,NotAfter

重要事項

移除、更新或指派憑證服務可從 Exchange 後端和預設網站移除憑證。 請務必檢查憑證繫結並套用正確的憑證。

其他資源

從 Exchange 後端網站移除自我簽署憑證之後,無法開啟 OWA、ECP 或 EMS