当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 如何修复 Get-ExchangeCertificate 显示空白输出

作者:精品下载站 日期:2024-12-14 06:31:18 浏览:14 分类:玩电脑

如何修复 Get-ExchangeCertificate 显示空白输出


我们想检查 Exchange Server 证书。在 Exchange 管理中心登录并检查它们,一切看起来都很好。但是当我们运行 Get-ExchangeCertificate cmdlet 时,它显示空白输出。为什么会发生这种情况?在本文中,您将了解如何修复 Get-ExchangeCertificate cmdlet 显示空白输出的问题。

Get-ExchangeCertificate cmdlet 显示空输出

组织中正在运行两台 Exchange Server(EX01-2019/EX02-2019)。让我们在两台 Exchange 服务器上运行 Get-ExchangeCertificate cmdlet。

Get-ExchangeCertificate

Exchange Server EX01-2019EX02-2019 上的输出显示空输出。

Thumbprint                                Services   Subject
----------                                --------   -------

为什么会出现此问题?运行 Get-ExchangeCertificate cmdlet 时出现空白输出的解决方案是什么?

Get-ExchangeCertificate 的解决方案显示空白输出

显示空白输出是因为启用了序列化有效负载签名,并且 Exchange 身份验证证书丢失或损坏。如果仅 Exchange Auth 证书丢失或损坏,并且未启用序列化负载签名,则 Get-ExchangeCertificate cmdlet 将在输出中显示值。

注意:自 2023 年 11 月 Exchange Server 安全更新及更高版本以来,现在默认启用 PowerShell 序列化负载的证书签名。

要解决此问题,我们必须在 Exchange Server 上安装新的 Exchange Auth 证书。

如果您已有 Exchange Auth 证书,并且在运行 Get-ExchangeCertificate 时显示空白输出,则意味着该证书已损坏。

重要提示:您刚刚安装了 Exchange Auth 证书吗?可能需要 24 小时才能生效。所以你必须等待并稍后检查。

1. 检查 Microsoft Exchange Server 身份验证证书

配置为身份验证证书的证书必须有效(未过期)并且在组织内的所有 Exchange 服务器(边缘传输角色和 Exchange 管理工具角色除外)上可用,这一点非常重要。

下载 MonitorExchangeAuthCertificate.ps1 PowerShell 脚本并将其放置在文件夹 C:\scripts 中。

启动 Exchange 命令行管理程序并运行以下命令来检查 Exchange 身份验证证书状态。

注意:要运行该脚本,您必须是组织管理角色组的成员。该脚本必须在运行邮箱角色的 Exchange Server 上从提升的 Exchange 命令行管理程序 (EMS) 命令提示符运行。该脚本无法在仅使用 Exchange 管理工具的计算机上运行。

C:\Scripts\.\MonitorExchangeAuthCertificate.ps1

输出显示 Exchange Auth 证书需要更换为新证书。

Monitor Exchange Auth Certificate script version 23.11.22.1714
The script was run without parameter therefore, only a check of the Auth Certificate configuration is performed and no change will be made

Current Auth Certificate thumbprint: 4010E939A05777DC08A4196830125B2AF2BDFBC1
Current Auth Certificate is valid for -1 day(s)
Exchange Hybrid was detected in this environment

The actively used Auth Certificate is missing on the following servers:
EX01-2019.exoip.local, EX02-2019.exoip.local

Test result: The Auth Certificate in use must be replaced by a new one.

Log file written to: C:\Program Files\Microsoft\Exchange Server\V15\Logging\AuthCertificateMonitoring\AuthCertificateMonitoringLog_20231201153933.txt

2. 更新 Exchange Auth 证书

运行以下命令来续订 Microsoft Exchange Auth 证书。

C:\scripts\.\MonitorExchangeAuthCertificate.ps1 -ValidateAndRenewAuthCertificate $true -IgnoreHybridConfig $true -Confirm:$false

输出显示续订操作已成功执行。

Monitor Exchange Auth Certificate script version 23.11.22.1714
Mode: Testing and replacing or importing the Auth Certificate (if required)
Renewal scenario: The Auth Certificate in use must be replaced by a new one.
WARNING: Waiting for service 'Microsoft Exchange Service Host (MSExchangeServiceHost)' to start...

The renewal action was successfully performed - the new Auth Certificate will become active on: 12/01/2023 15:43:41
Please ensure to run the Hybrid Configuration Wizard (HCW) as soon as the new Auth Certificate becomes active.

Log file written to: C:\Program Files\Microsoft\Exchange Server\V15\Logging\AuthCertificateMonitoring\AuthCertificateMonitoringLog_20231201154320.txt

注意:如果您有 Exchange 混合配置,则必须在新的身份验证证书生效后立即重新运行混合配置向导。在下一步中验证 Exchange Auth 证书后执行此操作。

3. 验证 Exchange Auth 证书

运行 MonitorExchangeAuthCertificate.ps1 脚本来检查 Exchange Auth 证书。

C:\Scripts\MonitorExchangeAuthCertificate.ps1

输出显示 Auth 证书有效。

Monitor Exchange Auth Certificate script version 23.11.22.1714
The script was run without parameter therefore, only a check of the Auth Certificate configuration is performed and no change will be made

Current Auth Certificate thumbprint: 6789B2FE30740132E2DDBF147023E7485F476526
Current Auth Certificate is valid for 1826 day(s)
Exchange Hybrid was detected in this environment

Test result: No renewal action is required

Log file written to: C:\Program Files\Microsoft\Exchange Server\V15\Logging\AuthCertificateMonitoring\AuthCertificateMonitoringLog_20231201155121.txt

4. 运行 Get-ExchangeCertificate cmdlet

运行 Get-ExchangeCertificate cmdlet 并验证输出是否包含值而不是空白输出。

Get-ExchangeCertificate

所有证书都出现在输出中并且看起来很棒。

Thumbprint                                Services   Subject
----------                                --------   -------
6789B2FE30740132E2DDBF147023E7485F476526  ....S..    CN=Microsoft Exchange Server Auth Certificate
804F01FADE7DF2AA309277F6BD0F96CF4B3C9B62  IP.WS..    CN=EX02-2019
6BC65424EC1FA8803CDE86F6286518FDB639BFB6  .......    CN=CLIUSR
7EB920C8E05D8DBD0E1CF0C06A584C879F674E60  .......    CN=WMSvc-SHA2-EX02-2019
0014716C6390CFFBA0794248EE248D40129D7020  .......    CN=CLIUSR

5. 重新运行混合配置向导

如果您有 Exchange 混合环境,则需要重新运行混合配置向导。

6.检查Exchange Server证书状态

运行 Exchange 运行状况检查器脚本并验证证书状态。

[PS] C:\scripts>Get-ExchangeServer | ?{$_.AdminDisplayVersion -Match "^Version 15"} | .\HealthChecker.ps1; .\HealthChecker.ps1 -BuildHtmlServersReport -HtmlReportFile "ExchangeAllServersReport.html"; .\ExchangeAllServersReport.html

这是安装新的 Exchange Auth 证书后的立即外观。所有证书状态均显示为未知

[玩转系统] 如何修复 Get-ExchangeCertificate 显示空白输出

最多等待 24 小时,然后再次运行运行状况检查器脚本。所有证书状态均显示为有效

[玩转系统] 如何修复 Get-ExchangeCertificate 显示空白输出

就是这样!

了解更多:如何在 Exchange Server 中导出证书 »

结论

您了解了如何修复 Get-ExchangeCertificate 显示空白输出的问题。运行 MonitorExchangeAuthCertificate.ps1 PowerShell 脚本并替换 Exchange Server 身份验证证书。最多等待 24 小时。之后,所有证书都显示为有效,并且输出有效。

您喜欢这篇文章吗?您可能还喜欢如何在 Exchange Server 中导入证书。不要忘记关注我们并分享这篇文章。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯