问题
Is there any way to check Out Of Office status of a person using EWS 2.0 Api. I tried using "OofSettings" class to retrieve the Out Of Office status. It works fine if I check my own out of office status but says Access is denied when I try to pass someone else's email address. Here is the code I used.
OofSettings userOOFSettings = service.GetUserOofSettings("sneh.tekriwal@intel.com");
//Now to check out of office status
Console.WriteLine(userOOFSettings.State); //Works fine when I check OOO status for my own email id
But when I change the email address and use any of my colleagues, it gives me access is denied. Is there any way around this as, I cannot get impersonation on other mailbox. Thanks :)
回答1:
If you have Exchange 2010 or later then you can get the OOF status using the OOF mailtip which doesn't require access to the target mailbox see http://blogs.msdn.com/b/devmsg/archive/2014/06/03/ews-how-to-retrieve-the-oof-out-of-facility-settings-message-using-ews-for-an-exchange-user.aspx for a sample
Cheers Glen
来源:https://stackoverflow.com/questions/28072469/retrieve-out-of-office-status-using-ews-2-0