Q. Do I need to create multiple instances of ExchangeService and callback listeners to handle new mail event on multiple user id with impersonation?
Ans. In Exchange 2013 we do have the option of grouping see here . In 2010 the only way is to use a separate Instances for every user you are impersonating.
Q. Without impersonation?
Ans. To use single user account to subscribe to events on folders of different users, user account your using for authentication must be granted Access to the Folders your subscribing to (either on the Folder using Add-MailboxFolderPermission
or Outlook delegation) or on the Mailbox using Add-MailboxPermission
. A single ExchangeService
instance can have only single user account credentials associated with it.
As a side note: There are throttling limitations around the total number of subscriptions one particular user can make see here.
Q. Also want to know given credentials of impersonating user, can I retrieve list of all users impersonated by that user.
Ans. There is no cmdlets or EWS operations that can tell you this, however if you having logging enabled then you should be able to track the user of impersonation though the logs on IIS and the EWS.log see here.