none
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 https://social.msdn.microsoft.com/Forums/en-US/395d8df4-d682-4e78-995e-0d398b481c08/ews-managed-api-how-to-copy-items-from-one-mailbox-to-other?forum=exchangesvrdevelopment 

    and here https://social.msdn.microsoft.com/Forums/en-US/32529e45-e4f1-4919-8670-ef7557211ff7/could-ews-managed-api-copy-one-item-from-one-mailbox-to-another-mailbox?forum=exchangesvrdevelopment 

    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 *@domain.co.za  -ResultSize Unlimited | Add-MailboxPermission -AccessRights FullAccess -User admin@domain.co.za

    Regards,

    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 https://msdn.microsoft.com/en-us/library/office/dn600291(v=exchg.150).aspx with the Id of the folder in the Target Mailbox .

    Cheers
    Glen

    Friday, January 6, 2017 4:56 AM