Exporing multiple folders from Exchange mailbox

Hi,

can we export multiple exchange folders to PST?

Hi Cornelius,

Thank you for your inquiry.

Yes, you can export multiple folders from Exchange Mailbox to PST. Each folder should be added to the FolderInfoCollection individually and then backup be taken from the Exchange Mailbox. Please try the following code sample and share your feedback with us.

Code:

File.Delete("ExBackup.pst");
IEWSClient client = GetAsposeEWSClient2();

ExchangeFolderInfoCollection coll = new ExchangeFolderInfoCollection();
ExchangeFolderInfo info = client.GetFolderInfo(client.MailboxInfo.InboxUri);
coll.Add(info);
info = client.GetFolderInfo(client.MailboxInfo.SentItemsUri);
coll.Add(info);
client.Backup(coll, "ExBackup.pst", BackupOptions.Recursive);