Get all calendar events for a specific user

2019-09-02 07:33发布

问题:

As part of creating a service for syncing an internal application's calendar with Outlook Calendar (Exchange) I need a way to get all of the events from the calendars of a list of users. Through EWS I can get access to a user's calendar with their credentials but I won't have access to the password of the users I need to get the calendar's for. Is there any way to get at any user's data using admin credentials and that user's mail address?

回答1:

Answering my own questions here but the answer is through impersonation. I had come across impersonation early but at first glance it wasn't what I was looking for but after reading more carefully it seems to be exactly what i need.

MSDN article on Impersonation

I'll have the server admin set up an account with impersonation permissions then connect to each account through their username/address and pull the calendar data I need with the GetUserAvailability method.