Yuriy Samorodov
Yuriy Samorodov

Reputation: 75

ToRecipients Will Not UpdateEWS Managed API 2.2

According to MSDN I am trying to update ToRecipients property is writable. When I run the following code in Powershell:

foreach ( $Item in $SearchResults ) {
            Write-Output $item.Subject
            $Item.Load()
            $Item.Sender.Name = 'TS'
            $item.IsRead = $false
            $item.Subject = 'Test'
            $item.ToRecipients.Name = 'DisplayName Three'
            $Item.Update([Microsoft.Exchange.WebServices.Data.ConflictResolutionMode]::AlwaysOverwrite)             
        }

It would Save subject, however neither Sender or ToRecipients get updated.

Could someone please advise what I am doing wrong?

Thank you

Upvotes: 0

Views: 52

Answers (1)

Glen Scales
Glen Scales

Reputation: 22032

According to MSDN I am trying to update ToRecipients property is writable

No that property is ReadOnly according to the documentation eg

enter image description here

That property is just a cacluated property based on the contents of the Recipients collection which I believe is also ReadOnly on a Message once its been received in EWS.

Upvotes: 1

Related Questions