Is there a way to search Exchange using the EWS Managed API for all email messages across ALL folders. I'm using the FindItems API call -- but that appears to require that the search be confined to a single folder.
private void InternalPurgeProcessFolder(FolderId folderId, ExchangeService service, SearchFilter searchCriteria) {
Logger.Info("Processing folder {0}", folderId.FolderName);
int pageSize = _runtimeParameters.ExchangeRetrievalPageSize;
ItemView itemView = new ItemView(pageSize);
itemView.PropertySet = Utils.BasicPropertySet();
const int maxInterationsForTesting = 2;
int iterations = 0;
FindItemsResults<Item> findResults;
do {
++iterations;
Logger.Debug("Start of iteration {0}", iterations);
findResults = service.FindItems(folderId, searchCriteria, itemView);
_dumper.ListDatesAndSubjectsBrief(findResults);
itemView.Offset += pageSize;
} while ((findResults.MoreAvailable) && (iterations < maxInterationsForTesting));
}