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

Update appointment body via EWS with powershell

$
0
0

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?




Viewing all articles
Browse latest Browse all 7132


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