Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Best method to find Exchange Server version for use with Exchange Web Services Managed API?

$
0
0

Hello,


I am attempting to write a method to find the Exchange Server version an Exchange Server I'm connecting to with EWS.

It is clear that reading the contents of a response XML to an EWS request contains this info, as described here.

I'm curious if I must test and error handle or if there's another "less invasive" method to find the Exchange version.

How do I find the version of an Exchange Server I am attempting to access with EWS so that I can set it for EWS managed API activity?


I am currently using the following, but I can't imagine this is the most efficient way?

foreach (ExchangeVersion exchver in Enum.GetValues(typeof(ExchangeVersion))) { //Console.WriteLine(exchver.ToString()); try { ExchangeService service = new ExchangeService(exchver); //Do stuff here } catch (Exception e) { Console.WriteLine("Server is not " + exchver +". Trying next ExchangeVersion."); } }



Any assistance is appreciated.

Thanks,

Matt


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>