EWS copy mail cross-mailbox using an O365 Daemon RRS feed

  • Question

  • Hi There,

    I am trying to determine if I can copy an item from one users mailbox to another using EWS Managed API.

    I have read from these posts here 

    and here 

    that this is possible. But I cannot find any code sample to show how this is done.

    Can any one provide a code sample of how this is done?  From reading from Glens advice, one has a couple of options. One can impersonate or Otherwise give the Service account FullAccess via Add-MailboxPermissions to Source and Target and don't use Impersonation 

    Can any code sample be provided on either of the above please? to help me determine the best way for me to go?

    Tuesday, December 27, 2016 2:56 AM

All replies

  • Hi,

    You can set delegate access from the one mailbox to the other. Then open the delegated mailbox and open the actual mailbox.

    Option 2, setup the actual mailbox and export the data to PST.

    Option 3, Run the following powershell script. This will a specific account full access to the mailbox.

    Get-Mailbox -Identity *  -ResultSize Unlimited | Add-MailboxPermission -AccessRights FullAccess -User


    Thursday, January 5, 2017 12:15 PM
  • Impersonation won't work if unless the Source Mailbox has full access to the Target Mailbox so you better off just using a service account.

    >> Can any one provide a code sample of how this is done?  

    Just use the Copy method with the Id of the folder in the Target Mailbox .


    Friday, January 6, 2017 4:56 AM