O'Reilly logo

Microsoft Exchange Server PowerShell Cookbook - Third Edition by Mike Pfeiffer, Jonas Andersson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Working with impersonation

When building PowerShell scripts that leverage the EWS Managed API, we can use impersonation to access a user's mailbox on their behalf, without having to provide their credentials. In order to utilize impersonation, we need permissions inside the Exchange organization, and then we need to configure the ExchangeService connection object with the impersonated user ID. In this recipe, you'll learn how to assign the permissions and write a script that uses EWS impersonation.

Getting ready

In this recipe, you will need to use the Exchange Management Shell in order to assign permissions for ApplicationImpersonation.

How to do it...

Let's see how to work with impersonation using the following steps:

  1. The first thing you need to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required