Comprobación del estado del servidor Exchange con script de PowerShell
Están surgiendo incidentes y problemas relacionados con Exchange Server y le gustaría comprobar el estado del servidor Exchange. ¿Cuál es la mejor manera de comprobar la salud? Quizás desee agregar un nuevo servidor Exchange al entorno y, antes de hacerlo, desee verificar su estado. Veamos cómo verificar el estado de Exchange Server con un excelente script de PowerShell.
Por qué desea comprobar el estado del servidor Exchange
Es bueno verificar el estado del servidor Exchange si hay incidentes, problemas o cambios que deba aplicar:
Hay un problema con el servidor Exchange.
Antes de actualizar Exchange Server CU a la última versión
Antes de instalar el asistente de configuración híbrida para migraciones de Office 365
-
Antes de crear un DAG entre servidores Exchange
Introduciendo un nuevo Exchange Server en la organización
Script de PowerShell de comprobación del estado del servidor Exchange
El script Exchange Server Health Checker ayuda a detectar problemas de configuración comunes que se sabe que causan problemas de rendimiento y otros problemas de larga duración causados por un simple cambio de configuración dentro de un entorno Exchange. También ayuda a recopilar información útil sobre su servidor para ayudar a acelerar la recopilación de información común de su servidor.
Por qué recomiendo usar este script de PowerShell:
Compatible con Exchange Server 2013/2016/2019
Un registro de cambios mantenido con todas las correcciones/características.
Está creado y mantenido por ingenieros de Microsoft.
Siempre buscando mejoras
Abierto a sugerencias y funciones.
Es 100% PowerShell
Es bueno saber que podría funcionar en Exchange Server 2007/2010, pero no es compatible.
Descargue y prepare el script de verificación de estado de Exchange
Descargue el script PowerShell del verificador de estado de Exchange desde la página oficial (GitHub). En el momento de escribir este artículo, probaré Exchange Server Performance Health Checker Script versión 3.1.1.
Es muy probable que si lees este artículo, la versión cambie. Esto se debe a que el equipo publica un par de actualizaciones cada mes, ¡lo cual es fantástico! Si tiene algún error, sugerencia de funciones o comentario, puede enviarlos por correo electrónico a extoolsfeedback@microsoft.com.
Coloque el script de PowerShell HealthChecker.ps1 en la carpeta Exchange Server C:\scripts. Si no tiene una carpeta de scripts, cree una. Asegúrese de verificar si el archivo está desbloqueado para evitar errores al ejecutar el script. Lea más en el artículo Error sin firma digital al ejecutar el script de PowerShell.
Verifique la firma antes de ejecutar el script con el cmdlet Get-AuthenticodeSignature.
[PS] C:\>Get-AuthenticodeSignature -FilePath "C:\Scripts\HealthChecker.ps1" | ft -AutoSize
Directory: C:\Scripts
SignerCertificate Status Path
----------------- ------ ----
ABDCA79AF9DD48A0EA702AD45260B3C03093FB4B Valid HealthChecker.ps1Ejecute el script de PowerShell del Comprobador de estado del servidor Exchange
Ejecute Exchange Management Shell como administrador en Exchange Server. Cambie la ruta del directorio a C:\scripts. Ejecute el script HealthChecker.ps1 y especifique el servidor Exchange. Si no identifica el servidor Exchange, comprobará el host local (en el que se encuentra ahora).
[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\24 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.xmlEl script Exchange HealthChecker.ps1 generará dos archivos. Estos archivos se generan en el mismo directorio del script. En este ejemplo, es la carpeta C:\scripts.
1x archivo TXT: El archivo txt es el mismo que el resultado en PowerShell. Pero es útil si desea adjuntarlo a un correo electrónico o colocarlo en una carpeta.
-
1x archivo XML: Para ver mejor el archivo XML, debe ejecutar otro comando para generar un informe. Vea abajo.
Generar informe de estado de Exchange
[PS] C:\scripts>.\HealthChecker.ps1 -BuildHtmlServersReport -HtmlReportFile "EX01-2016Report.html"Se crea un nuevo EX01-2016Report.html en la carpeta de scripts.
Abra el informe de estado de Exchange EX01-2016Report.
Verás los colores:
Gris: Elementos informativos
Verde: configuraciones encontradas que coinciden con las recomendaciones
Amarillo: configuraciones que muestran una advertencia que puedes consultar
Rojo: Configuraciones que pueden causar problemas de rendimiento
Los más importantes que debes cuidar son los rojos. Revíselo con atención.
Tenga en cuenta que la mayoría de estas recomendaciones solo se aplican a Exchange 2013/2016/2019. El script se ejecutará en Exchange 2010/2007, pero el resultado es más limitado.
¿Tiene más de un servidor Exchange en ejecución? Quiere tener un informe de estos servidores Exchange. Echemos un vistazo a eso en el siguiente paso.
Genere un informe de estado de Exchange para múltiples servidores Exchange
Obtenga el informe de estado de otro servidor Exchange. En mi ejemplo, Exchange Server EX02-2016.
[PS] C:\scripts>.\HealthChecker.ps1 -Server "EX02-2016"El script creó dos archivos en la carpeta de scripts.
Genere el informe de estado de Exchange. Esta vez, utilice únicamente el parámetro -BuildHtmlServersReport. Reunirá todos los archivos XML en la carpeta C:\scripts y generará un informe de estado de Exchange.
[PS] C:\scripts>.\HealthChecker.ps1 -BuildHtmlServersReportSe crea un nuevo archivo ExchangeAllServersReport.html en la carpeta de scripts.
Genere un informe de estado de Exchange para todos los servidores Exchange
Otra opción es ejecutar el cmdlet para crear un informe para todos los servidores Exchange. Ejecutará el informe HTML y lo abrirá automáticamente.
[PS] C:\scripts>Get-ExchangeServer | ?{$_.AdminDisplayVersion -Match "^Version 15"} | %{.\HealthChecker.ps1 -Server $_.Name}; .\HealthChecker.ps1 -BuildHtmlServersReport; .\ExchangeAllServersReport.htmlSi el informe no se abre automáticamente, puede encontrarlo en la carpeta C:\scripts. Abra el informe de estado del servidor Exchange ExchangeAllServersReport.
Si todo se muestra en verde, ya está todo listo. Si es amarillo, míralo. ¿Ves elementos rojos en el informe de estado de Exchange? Le recomendamos que lo solucione.
Leer más: Verifique los buzones de correo de estado de Exchange »
Conclusión
En este artículo, aprendió cómo verificar el estado de Exchange Server con el script PowerShell HealthChecker.ps1. Un par de scripts en Internet realizarán una verificación del estado del servidor Exchange, pero los autores no mantienen el script actualizado como este.
En el mundo de la tecnología, es necesario proporcionar nuevas funciones, correcciones de errores y ajustes para disfrutar de todo el potencial del software. Es por eso que recomiendo usar sólo este script para una verificación del estado de Exchange. Es un excelente script de PowerShell que debes tener en tu colección.
Disfrutaste este artículo? También te puede interesar Sacar Exchange Server del modo de mantenimiento. No olvides seguirnos y compartir este artículo.







