3
是否有一種方法可以使用EWS託管API對所有文件夾中的所有電子郵件進行搜索Exchange。我正在使用FindItems API調用 - 但似乎要求將搜索限制在單個文件夾中。使用Exchange Web服務對Exchange進行跨文件夾搜索
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));
}