EWS User Impersonation, advantages, why?


First off all I respect all points of views, this post is intend only to expose my opinion.


First go to Roles & Management and then Discovery Management, Second, add a function ApplicationImpersonation, then add the Administrator User Name

image image


When you connect to exchange online, you must communicate with an Exchange Web Service within a mailbox user and a password, but if you are logged with a non Administrator user you may not have Full control over the Service. This may be true when you have Hybrid Systems, and in some procedures like CreateReply() or CreateForward() you may experience Access Denied Exceptions.

Another point is if you use the Administrator Credentials and Impersonate another Mailbox you don’t have to know that users credentials and this may be an advantage in all ways.

How can we do this?

Just use your service binding method, or get it here and impersonate the service like this

service.ImpersonatedUserId = new ImpersonatedUserId
      "You non Admin MailBox");