21 December 2019

Powershell script: Outlook To Exchange connection test

Outlook can lose connection with Exchange for various reasons and even if it happened once, it still can impact the business. To help administrators identify the core of an issue I wrote this Powershell script.
The script is designed for Outlook 2013-2019 clients that connected to Exchange 2016-2019 by "MAPI over HTTP" protocol.
Before start the script change two variables:
$Exchange = "exchange.test.local"
$SMTPDomain = "test.local"
The result is presented as an HTML page.


What does the script do?


  1. Show common information about workstation, operation system, dns, network settings, etc.
  2. Check current connections to Exchange server.
  3. Check MAPI, EWS, Autodiscover health checks.
  4. Show all installed Outlook on workstation with version number.
  5. Show events regarding Outlook from Event Log for last 10 minutes.

What problems can be identified?


  1. Network issues (e.g. 443 TCP port closed on firewall; dns get wrong IPs).
  2. Client configuration issues (e.g. old or wrong IP of Exchange Server in the hosts file).
  3. Exchange issues (e.g. MAPI or EWS web services not responding).

How can I use it?


  1. Run manually when it needed.
  2. Create Schedule task with triger for an error #26 in "Application" Event Log (Source:Outlook + Text:"Connection to Microsoft Exchange has been lost").

Report examples




Download

Feel free to change and upgrade the script on GitHub.

No comments:

Post a Comment