none
Connect to a user mailbox put under soft delete using EWS RRS feed

  • Question

  • hi,

    I am writing an application using EWS which connects to users mailboxes put under soft delete, and gets their folders. These mailboxes are on Exchange 2013.

    Below is the code snippet :

     

     // Set impersonated mailbox
     ImpersonatedUserId idIEMX = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, userEmail);
     this.serviceEWS.ImpersonatedUserId = idIEMX;

     // Get root folder handle
     Microsoft.Exchange.WebServices.Data.Folder rootfolder = null;

    // on the below bind step I am getting the exception "The SMTP address has no mailbox associated with it"

     rootfolder = Microsoft.Exchange.WebServices.Data.Folder.Bind(this.serviceEWS, WellKnownFolderName.MsgFolderRoot);

    rootfolder.Load();

    Can anyone please help me to know on how to connect to mailboxes which are put on soft delete in exchange. I even tried with GUID@domain.com, and its not working.

    Thanks in advance



    ashishshukla.1183

    Friday, October 16, 2015 3:49 PM

Answers

  • I am pretty sure that won't work with EWS or any Exchange API when you delete a Mailbox you delete its Active Directory association so at that point it won't be accessible because there is no valid Security context. If you require access to the Mailbox it needs to be reconnected to a valid AD account which would make it accessible again.

    Cheers
    Glen

    Friday, October 16, 2015 9:49 PM

All replies

  • Account you are using should have Impersonate role assigned to carry out this task.

    PREM RANA MCSE Exchange 2013, MCSA 2012 Server MCTS Exchange 2007,2010, MCITP Exchange 2007,2010 MCSE 2003 Server, MCSA Exchange 2003 ITIL V3 Foundation https://ranaprem.wordpress.com/ This posting is provided AS IS with no warranties,and confers no rights.

    Friday, October 16, 2015 4:17 PM
  • Account has the full access to impersonate any account.

    I am able to impersonate the mailboxes which are not on soft delete. This exception is only coming for one's on soft delete.


    ashishshukla.1183

    Friday, October 16, 2015 4:21 PM
  • I am pretty sure that won't work with EWS or any Exchange API when you delete a Mailbox you delete its Active Directory association so at that point it won't be accessible because there is no valid Security context. If you require access to the Mailbox it needs to be reconnected to a valid AD account which would make it accessible again.

    Cheers
    Glen

    Friday, October 16, 2015 9:49 PM