2

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 :)

Sneh
  • 3,527
  • 2
  • 19
  • 37
  • possible duplicate of [How to get Out of Office for another mailbox](http://stackoverflow.com/questions/16795929/how-to-get-out-of-office-for-another-mailbox) – codingbadger Jan 21 '15 at 16:50
  • There was no accepted answer to that question. So I thought to ask it again. :( Also none of the answer solve my question. – Sneh Jan 21 '15 at 16:54
  • From the answer provided, it would seem that you need to use impersonation to do this. – codingbadger Jan 21 '15 at 16:58
  • As I mentioned in the question impersonation is not a choice for me, as I won't be allowed permissions on mailboxes of other users in my organisation. – Sneh Jan 21 '15 at 17:01

1 Answers1

3

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

Glen Scales
  • 20,495
  • 1
  • 20
  • 23