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

Getting connected to EWS

When working with EWS, you first need to create an instance of the ExchangeService class that can be used to send SOAP messages to an Exchange server. This class has several properties and methods that can be used to specify explicit credentials, set the web service's end-point URL, or make a connection using the built-in AutoDiscover client. In this recipe, you'll learn how to make a connection to EWS that can be used to run custom scripts against the web service.

How to do it...

Let's see how to get connected to EWS using the following steps:

  1. The first thing we need to do is load the EWS Managed API assembly into the shell:
    Add-Type -Path C:\EWS\Microsoft.Exchange.WebServices.dll
    
  2. Now we can create an instance of the ExchangeService ...

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