[玩转系统] 使用 PowerShell 脚本检查 Exchange Server 运行状况
作者:精品下载站 日期:2024-12-14 22:32:10 浏览:15 分类:玩电脑
使用 PowerShell 脚本检查 Exchange Server 运行状况
有关 Exchange Server 的事件和问题不断出现,您希望检查 Exchange Server 的运行状况。检查健康状况的最佳方法是什么?也许您想要向环境中添加新的 Exchange Server,在执行此操作之前,您需要检查运行状况。让我们看看如何使用优秀的 PowerShell 脚本对 Exchange Server 进行健康检查。
为什么要检查 Exchange Server 运行状况
如果出现事件、问题或必须应用的更改,最好检查 Exchange Server 的运行状况:
Exchange 服务器有问题
将 Exchange Server CU 升级到最新版本之前
安装 Office 365 迁移的混合配置向导之前
-
在 Exchange 服务器之间创建 DAG 之前
在组织中引入新的 Exchange Server
Exchange Server 运行状况检查 PowerShell 脚本
Exchange Server 运行状况检查器脚本可帮助检测已知会导致性能问题的常见配置问题以及由 Exchange 环境中的简单配置更改引起的其他长期运行问题。它还有助于收集有关服务器的有用信息,以帮助加快服务器的常见信息收集速度。
为什么我建议使用此 PowerShell 脚本:
支持Exchange服务器2013/2016/2019
包含所有修复/功能的变更日志
它由 Microsoft 工程师创建和维护
总是寻求改进
接受建议和功能
100% PowerShell
值得高兴的是,它可能适用于 Exchange Server 2007/2010,但不受支持。
下载并准备 Exchange 运行状况检查脚本
从官方页面 (GitHub) 下载 Exchange 运行状况检查器 PowerShell 脚本。在撰写本文时,我将测试 Exchange Server 性能运行状况检查器脚本版本 3.1.1。
如果您阅读本文,则很有可能版本已更改。这是因为该团队每个月都会发布几个更新,这非常棒!如果您确实有任何错误、功能建议或反馈,可以通过电子邮件发送至 [email protected]。
将 HealthChecker.ps1 PowerShell 脚本放置在 Exchange Server C:\scripts 文件夹中。如果您没有脚本文件夹,请创建一个。确保检查文件是否已解锁,以防止运行脚本时出现任何错误。请阅读文章运行 PowerShell 脚本时出现未数字签名错误来了解更多信息。
在使用 Get-AuthenticodeSignature cmdlet 运行脚本之前验证签名。
[PS] C:\>Get-AuthenticodeSignature -FilePath "C:\Scripts\HealthChecker.ps1" | ft -AutoSize
Directory: C:\Scripts
SignerCertificate Status Path
----------------- ------ ----
ABDCA79AF9DD48A0EA702AD45260B3C03093FB4B Valid HealthChecker.ps1
运行 Exchange Server 运行状况检查器 PowerShell 脚本
在 Exchange Server 上以管理员身份运行 Exchange 命令行管理程序。将目录路径更改为C:\scripts。运行 HealthChecker.ps1 脚本并指定 Exchange Server。如果您不识别 Exchange Server,它将检查本地主机(您现在所在的主机)。
[PS] C:\scripts>.\HealthChecker.ps1 -Server "EX01-2016"
Exchange Health Checker version 3.1.1
Virtual Machine detected. Certain settings about the host hardware cannot be detected from the virtual machine. Verify on the VM Host that:
- There is no more than a 1:1 Physical Core to Virtual CPU ratio (no oversubscribing)
- If Hyper-Threading is enabled do NOT count Hyper-Threaded cores as physical cores
- Do not oversubscribe memory or use dynamic memory allocation
Although Exchange technically supports up to a 2:1 physical core to vCPU ratio, a 1:1 ratio is strongly recommended for performance reasons. Certain third party Hyper-Visors such as VMWare have their own guidance.
VMWare recommends a 1:1 ratio. Their guidance can be found at https://www.vmware.com/files/pdf/Exchange_2013_on_VMware_Best_Practices_Guide.pdf.
Related specifically to VMWare, if you notice you are experiencing packet loss on your VMXNET3 adapter, you may want to review the following article from VMWare: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2039495.
For further details, please review the virtualization recommendations on Microsoft Docs at the following locations:
Exchange 2013: https://learn.microsoft.com/en-us/exchange/exchange-2013-virtualization-exchange-2013-help#requirements-for-hardware-virtualization.
Exchange 2016/2019: https://learn.microsoft.com/en-us/exchange/plan-and-deploy/virtualization?view=exchserver-2019.
Exchange Information
--------------------
Name: EX01-2016
Version: Exchange 2016 CU17
Build Number: 15.1.2044.4
Error: Out of date Cumulative Update. Please upgrade to one of the two most recently released Cumulative Updates. Currently running on a build that is 194 days old.
Server Role: Mailbox
MAPI/HTTP Enabled: True
Exchange Server Maintenance: Server is not in Maintenance Mode
Operating System Information
----------------------------
Version: Microsoft Windows Server 2016 Standard Evaluation
System Up Time: 2 day(s) 16 hour(s) 34 minute(s) 28 second(s)
Time Zone: W. Europe Standard Time
Dynamic Daylight Time Enabled: True
.NET Framework: 4.8
Page File Size: Error: System is set to automatically manage the pagefile size.
Power Plan: Balanced --- Error
Http Proxy Setting: <None>
Visual C++ 2012: Redistributable is outdated
Visual C++ 2013: Redistributable is outdated
Note: For more information about the latest C++ Redistributeable please visit: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
This is not a requirement to upgrade, only a notification to bring to your attention.
Server Pending Reboot: False
Processor/Hardware Information
------------------------------
Type: VMWare
Processor: Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Number of Processors: 4
Note: Please make sure you are following VMware's performance recommendation to get the most out of your guest machine. VMware blog 'Does corespersocket Affect Performance?' https://blogs.vmware.com/vsphere/2013/10/does-corespersocket-affect-performance.html
Number of Physical Cores: 4
Number of Logical Cores: 4
Hyper-Threading: Disabled
All Processor Cores Visible: Passed
Max Processor Speed: 2304
Physical Memory: 12 GB
NIC Settings Per Active Adapter
-------------------------------
Interface Description: vmxnet3 Ethernet Adapter [Ethernet0]
Driver Date: 2019-07-11
Driver Version: 1.8.16.0
MTU Size: 1500
RSS Enabled: True
Link Speed: 10000 Mbps --- This may not be accurate due to virtualized hardware
IPv6 Enabled: True
IPv4 Address:
Address: 192.168.1.52 Gateway: 192.168.1.1
IPv6 Address:
DNS Server: 192.168.1.51
Registered In DNS: True
Sleepy NIC Disabled: False --- Warning: It's recommended to disable NIC power saving options
More Information: http://support.microsoft.com/kb/2740020
Packets Received Discarded: 0
Frequent Configuration Issues
-----------------------------
TCP/IP Settings: Not Set
Error: Without this value the KeepAliveTime defaults to two hours, which can cause connectivity and performance issues between network devices such as firewalls and load balancers depending on their configuration.
More details: https://techcommunity.microsoft.com/t5/Exchange-Team-Blog/Checklist-for-troubleshooting-Outlook-connectivity-in-Exchange/ba-p/604792
RPC Min Connection Timeout: 0
More Information: https://blogs.technet.microsoft.com/messaging_with_communications/2012/06/06/outlook-anywhere-network-timeout-issue/
CTS Processor Affinity Percentage: 0
Credential Guard Enabled: False
Security Settings
-----------------
LmCompatibilityLevel Settings: 3
Description: Clients use only NTLMv2 authentication, and they use NTLMv2 session security if the server supports it. Domain controllers accept LM, NTLM, and NTLMv2 authentication.
TLS 1.0
Server Enabled: True
Server Disabled By Default: False
Client Enabled: True
Client Disabled By Default: False
TLS 1.1
Server Enabled: True
Server Disabled By Default: False
Client Enabled: True
Client Disabled By Default: False
TLS 1.2
Server Enabled: True
Server Disabled By Default: False
Client Enabled: True
Client Disabled By Default: False
Certificate:
FriendlyName: Microsoft Exchange Server Auth Certificate
Thumbprint: 96AC7BAD02F000A6C9B0DFEB5F15A59FE396D5F2
Lifetime in days: 1758
Key size: 2048
Bound to services: SMTP
Current Auth Certificate: True
SAN Certificate: False
Namespaces:
Microsoft Exchange Server Auth Certificate
Certificate:
FriendlyName: Microsoft Exchange
Thumbprint: 8CF11037A346A3BE602E99171FFB32C07F3F2196
Lifetime in days: 1784
Key size: 2048
Bound to services: IMAP, POP, IIS, SMTP
Current Auth Certificate: False
SAN Certificate: True
Namespaces:
EX01-2016
EX01-2016.exoip.local
Certificate:
FriendlyName: mail.exoip.com @ 2020/10/3 16:46:13
Thumbprint: 11A8E3212103DD17734E46F5F4DFEA1ABC41AD35
Lifetime in days: 5
Key size: 3072
Bound to services: IIS, SMTP
Current Auth Certificate: False
SAN Certificate: True
Namespaces:
autodiscover.exoip.com
mail.exoip.com
Certificate:
FriendlyName: WMSVC-SHA2
Thumbprint: A520A23C9032B0D2B62BA812F2DBF91BB580D228
Lifetime in days: 3555
Key size: 2048
Bound to services: None
Current Auth Certificate: False
SAN Certificate: False
Namespaces:
WMSvc-SHA2-EX01-2016
Valid Auth Certificate Found On Server: True
SMB1 Installed: True
SMB1 Blocked: False
SMB1 should be uninstalled SMB1 should be blocked
More Information: https://techcommunity.microsoft.com/t5/exchange-team-blog/exchange-server-and-smbv1/ba-p/1165615
Security Vulnerability: CVE-2020-16875
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-16875 for more information.
Security Vulnerability: CVE-2020-16969
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-16969 for more information.
Security Vulnerability: CVE-2020-17083
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-17083 for more information.
Security Vulnerability: CVE-2020-17084
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-17084 for more information.
Security Vulnerability: CVE-2020-17085
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-17085 for more information.
Security Vulnerability: CVE-2020-17117
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-17117 for more information.
Security Vulnerability: CVE-2020-17132
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-17132 for more information.
Security Vulnerability: CVE-2020-17141
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-17141 for more information.
Security Vulnerability: CVE-2020-17142
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-17142 for more information.
Security Vulnerability: CVE-2020-17143
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-17143 for more information.
Security Vulnerability: CVE-2020-1147
See: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-1147 for more information.
Exchange Web App Pools
----------------------
Web App Pool: GC Server Mode Enabled | Status
MSExchangeServicesAppPool: False | Started
MSExchangeMapiFrontEndAppPool: False | Started
MSExchangeOWAAppPool: False | Started
MSExchangeRestAppPool: False | Started
MSExchangeMapiAddressBookAppPool: False | Started
MSExchangeRpcProxyFrontEndAppPool: False | Started
MSExchangePowerShellAppPool: False | Started
MSExchangePowerShellFrontEndAppPool: False | Started
MSExchangeRestFrontEndAppPool: False | Started
MSExchangeMapiMailboxAppPool: False | Started
MSExchangeOABAppPool: False | Started
MSExchangePushNotificationsAppPool: False | Started
MSExchangeOWACalendarAppPool: False | Started
MSExchangeAutodiscoverAppPool: False | Started
MSExchangeECPAppPool: False | Started
MSExchangeSyncAppPool: True | Started
MSExchangeRpcProxyAppPool: False | Started
Output file written to .\HealthCheck-EX01-2016-20201227132103.txt
Exported Data Object Written to .\HealthCheck-EX01-2016-20201227132103.xml
Exchange HealthChecker.ps1 脚本将生成两个文件。这些文件在脚本的同一目录中生成。在此示例中,它是文件夹 C:\scripts。
1x TXT 文件: 该 txt 文件与 PowerShell 中的输出相同。但如果您想将其附加到电子邮件或将其放入文件夹中,它会很方便。
-
1x XML 文件:为了更好地查看 XML 文件,您必须运行另一个命令来生成报告。见下文。
生成 Exchange 运行状况报告
[PS] C:\scripts>.\HealthChecker.ps1 -BuildHtmlServersReport -HtmlReportFile "EX01-2016Report.html"
将在脚本文件夹中创建一个新的 EX01-2016Report.html。
打开 Exchange 运行状况报告 EX01-2016Report。
你会看到颜色:
灰色:信息项目
绿色:找到与建议匹配的设置
黄色: 发出警告的设置,您可以查看
红色:可能导致性能问题的设置
您需要照顾的最重要的是红色的。仔细看一遍。
请注意,其中大部分建议仅适用于 Exchange 2013/2016/2019。该脚本将针对 Exchange 2010/2007 运行,但输出更加有限。
您是否有多个正在运行的 Exchange Server?您想要获得这些 Exchange 服务器的报告。让我们在下一步中看看。
为多个 Exchange 服务器生成 Exchange 运行状况报告
获取另一台 Exchange Server 的运行状况报告。在我的示例中,Exchange Server EX02-2016。
[PS] C:\scripts>.\HealthChecker.ps1 -Server "EX02-2016"
该脚本在脚本文件夹中创建了两个文件。
生成 Exchange 运行状况报告。这次,仅使用-BuildHtmlServersReport参数。它将收集 C:\scripts 文件夹中的所有 XML 文件并生成 Exchange 运行状况报告。
[PS] C:\scripts>.\HealthChecker.ps1 -BuildHtmlServersReport
将在脚本文件夹中创建一个新的 ExchangeAllServersReport.html 文件。
为所有 Exchange 服务器生成 Exchange 运行状况报告
另一种选择是运行 cmdlet 来为所有 Exchange 服务器创建报告。它将运行 HTML 报告并自动打开它。
[PS] C:\scripts>Get-ExchangeServer | ?{$_.AdminDisplayVersion -Match "^Version 15"} | %{.\HealthChecker.ps1 -Server $_.Name}; .\HealthChecker.ps1 -BuildHtmlServersReport; .\ExchangeAllServersReport.html
如果报告没有自动打开,您可以在 C:\scripts 文件夹中找到该报告。打开 Exchange Server 运行状况报告 ExchangeAllServersReport。
如果一切都显示绿色,则一切就绪。如果是黄色的,请检查一下。您在 Exchange 运行状况报告中看到红色项目了吗?我们建议您修复它。
了解更多:检查 Exchange 运行状况邮箱 »
结论
在本文中,您了解了如何使用 PowerShell HealthChecker.ps1 脚本检查 Exchange Server 运行状况。 Internet 上的几个脚本将执行 Exchange Server 运行状况检查,但作者并没有像这个脚本那样使脚本保持最新状态。
在技术世界中,您必须提供新功能、错误修复和调整才能充分发挥软件的潜力。这就是为什么我建议仅使用此脚本进行 Exchange 运行状况检查。这是一个优秀的 PowerShell 脚本,您必须收藏它。
您喜欢这篇文章吗?您可能还喜欢使 Exchange Server 退出维护模式。不要忘记关注我们并分享这篇文章。
猜你还喜欢
- 03-30 [玩转系统] 如何用批处理实现关机,注销,重启和锁定计算机
- 02-14 [系统故障] Win10下报错:该文件没有与之关联的应用来执行该操作
- 01-07 [系统问题] Win10--解决锁屏后会断网的问题
- 01-02 [系统技巧] Windows系统如何关闭防火墙保姆式教程,超详细
- 12-15 [玩转系统] 如何在 Windows 10 和 11 上允许多个 RDP 会话
- 12-15 [玩转系统] 查找 Exchange/Microsoft 365 中不活动(未使用)的通讯组列表
- 12-15 [玩转系统] 如何在 Windows 上安装远程服务器管理工具 (RSAT)
- 12-15 [玩转系统] 如何在 Windows 上重置组策略设置
- 12-15 [玩转系统] 如何获取计算机上的本地管理员列表?
- 12-15 [玩转系统] 在 Visual Studio Code 中连接到 MS SQL Server 数据库
- 12-15 [玩转系统] 如何降级 Windows Server 版本或许可证
- 12-15 [玩转系统] 如何允许非管理员用户在 Windows 中启动/停止服务
取消回复欢迎 你 发表评论:
- 精品推荐!
-
- 最新文章
- 热门文章
- 热评文章
[短剧] 2025年06月03日 精选+付费短剧推荐25部
[软件合集] 25年6月3日 精选软件44个
[短剧合集] 2025年06月2日 精选+付费短剧推荐39部
[软件合集] 25年6月2日 精选软件18个
[软件合集] 25年6月1日 精选软件15个
[短剧合集] 2025年06月1日 精选+付费短剧推荐59部
[短剧] 2025年05月31日 精选+付费短剧推荐58部
[软件合集] 25年5月31日 精选软件66个
[电影] 黄沙漫天(2025) 4K.EDRMAX.杜比全景声 / 4K杜比视界/杜比全景声
[风口福利] 短视频红利新风口!炬焰创作者平台重磅激励来袭
[剧集] [央视][笑傲江湖][2001][DVD-RMVB][高清][40集全]李亚鹏、许晴、苗乙乙
[电视剧] 欢乐颂.5部全 (2016-2024)
[电视剧] [突围] [45集全] [WEB-MP4/每集1.5GB] [国语/内嵌中文字幕] [4K-2160P] [无水印]
[影视] 【稀有资源】香港老片 艺坛照妖镜之96应召名册 (1996)
[剧集] 神经风云(2023)(完结).4K
[剧集] [BT] [TVB] [黑夜彩虹(2003)] [全21集] [粤语中字] [TV-RMVB]
[资源] B站充电视频合集,包含多位重量级up主,全是大佬真金白银买来的~【99GB】
[影视] 内地绝版高清录像带 [mpg]
[书籍] 古今奇书禁书三教九流资料大合集 猎奇必备珍藏资源PDF版 1.14G
[美图] 2W美女个美女小姐姐,饱眼福
[电视剧] [突围] [45集全] [WEB-MP4/每集1.5GB] [国语/内嵌中文字幕] [4K-2160P] [无水印]
[剧集] [央视][笑傲江湖][2001][DVD-RMVB][高清][40集全]李亚鹏、许晴、苗乙乙
[电影] 美国队长4 4K原盘REMUX 杜比视界 内封简繁英双语字幕 49G
[电影] 死神来了(1-6)大合集!
[软件合集] 25年05月13日 精选软件16个
[精品软件] 25年05月15日 精选软件18个
[绝版资源] 南与北 第1-2季 合集 North and South (1985) /美国/豆瓣: 8.8[1080P][中文字幕]
[软件] 25年05月14日 精选软件57个
[短剧] 2025年05月14日 精选+付费短剧推荐39部
[短剧] 2025年05月15日 精选+付费短剧推荐36部
- 最新评论
-
- 热门tag