Exchange: Checking the CAS and MBX servers used in an EWS Request

Recently I have been working on an issue where EWS requests sent to an Exchange environment were not working with the expected Exchange Version. The environment was in transition so was running both Exchange 2016 and 2010. All mailboxes involved in the request were hosted on 2016 and the CAS services had already been cut over to 2016.

This short script will connect to a mailbox using EWS and then show the server version, Front End (CAS) server, and Back-End (Mailbox) server that handled the request.

Simply change the Autodiscover Url to a primary email address of a mailbox that you have permission to as the account running the script.

You can also change the $ExchangeVersion parameter to the desired EWS version. The options can be found here:

To run this script you will need to have the Exchange Web Services API installed, which can be downloaded from here:

This is very much a test script – there is no error handling or verification, and credentials are shown in plain text.

Be the first to like.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.