Я использую EWS и хочу получить глобальный список адресов на бирже для компании. Я знаю, как получить личный список контактов.
Все примеры в документации API касаются обновления информации о пользователях, но не конкретно, как их получить.
Я даже пробовал следующее, чтобы перечислить папки, но это не дает правильных результатов.
private static void ListFolder(ExchangeService svc, FolderId parent, int depth) {
string s;
foreach (var v in svc.FindFolders(parent, new FolderView(int.MaxValue))) {
Folder f = v as Folder;
if (f != null) {
s = String.Format("[{0}]", f.DisplayName);
Console.WriteLine(s.PadLeft(s.Length + (depth * 2)));
ListFolder(svc, f.Id, depth + 1);
try {
foreach (Item i in f.FindItems(new ItemView(20))) {
Console.WriteLine(
i.Subject.PadLeft(i.Subject.Length + ((depth + 1) * 2)));
}
} catch (Exception) {
}
}
}
}
Хотя вопрос уже поднимался (как получить список контактов из Exchange Server?) этот вопрос касается использования EWS для получения глобального списка адресов, в то время как этот вопрос требует совета на общем уровне.