none
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.

    https://technet.microsoft.com/en-us/library/hh135098(v=exchg.150).aspx

    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")

    https://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.exchangeversion(v=exchg.80).aspx

    >> Now insert it in your script...

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

    Note:

    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:

    https://msdn.microsoft.com/en-us/library/office/dd633705

    https://technet.microsoft.com/en-us/library/hh135098(v=exchg.150).aspx



    KrishKT


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