How to get version using EWS powershell RRS feed

  • Question

  • $Service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2013_SP1);

    In the above line Exchange2013_SP1 is hardcoded. Using powershell how can I dynamically get the version when running the script?

    Wednesday, January 17, 2018 6:56 PM

All replies

  • Try: Get-ExchangeServer | select name, ServerRole, {$_.AdminDisplayVersion}

    You will get the bill number and that should give you the version via the below URL.

    Wednesday, January 17, 2018 11:36 PM

    >> Use 'Get-ExchangeServer' to get the current admin version of Exchange server

    >> And based on the starting number (08/14/15/..) of the admin version, Select the appropriate member name from the link below and store it in a variable (e.g. $ExchVer = "MemberNameBasedonAdminVersion")

    >> Now insert it in your script...

    $Service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::$ExchVer);


    If you do not specify a version, EWS will use the latest version of Exchange Server that is known to the EWS Managed API.

    More info:


    • Edited by KrishKT Tuesday, January 23, 2018 7:18 AM
    Tuesday, January 23, 2018 7:06 AM