Get data from a sub folder of a shared mailbox in Exchange

Im trying to design a select query to get the email items in a Inbox subfolder of a shared mailbox when using the Exchange ODBC driver (Exchange online/Office 365). I can get to the shared folder inbox but not query the subfolder. Can anyone help me figure it out please?

Hi @RichardGardner

In order to get Items from a SubFolder via the Exchange ODBC driver you will need to specify the ParentFolderId as well as the SharedMailboxEmail pseudo column in your query. You might want to try a query as follows:

SELECT * FROM Inbox where ParentFolderId in (Select FolderId from Folders where ParentFolderName='Inbox') AND SharedMailBoxEmail='shared_email'

In case you want to get data for a particular SubFolder you can try the following:

SELECT * FROM Inbox where ParentFolderId in (Select FolderId from Folders where DisplayName='name') AND SharedMailBoxEmail='shared_email'

You can read more about this in the help documentation:

If you have any other questions or encounter any technical issues you can always reach out to our support team at support@cdata.com or submit a support ticket with us here.