locked
Update appointment body via EWS with powershell RRS feed

  • Question

  • How to update appointment message body via EWS in powershell? I can find appointment through $service.FindAppointments but I can't get body message. Please help!

    My code:

    Import-Module "C:\Program Files (x86)\Microsoft\Exchange\Web Services\2.1\Microsoft.Exchange.WebServices.dll"

    $service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2007_SP1)

    $creds = New-Object System.Net.NetworkCredential('login','pass')
    $service.Credentials = $creds

    foreach ($Mailbox in $Mailboxes) {

    $service.AutodiscoverUrl($Mailbox.PrimarySMTPAddress.tostring())
    $service.ImpersonatedUserId = New-Object Microsoft.Exchange.WebServices.Data.ImpersonatedUserId([Microsoft.Exchange.WebServices.Data.ConnectingIdType]::SmtpAddress,$Mailbox.PrimarySMTPAddress.tostring())
    $folderid = [Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Calendar
    $findItems = $service.FindAppointments($folderid,(New-Object Microsoft.Exchange.WebServices.Data.CalendarView($StartTime,$EndTime)))

    }

    And:
    1. how to get body?
    2. how to modify body and save changes in source appointment?



    • Edited by Marcino1234 Wednesday, November 9, 2016 2:00 PM
    Wednesday, November 9, 2016 1:19 PM

All replies