July 2017
Intermediate to advanced
648 pages
31h 9m
English
The first thing you need to do is assign your account the ApplicationImpersonation RBAC role from the Exchange Management Shell:
New-ManagementRoleAssignment -Role ApplicationImpersonation `
-User administrator
After we've been granted the permissions, we need to import the EWS Managed API assembly and configure the ExchangeService connection object:
Add-Type -Path C:\EWS\Microsoft.Exchange.WebServices.dll
$svc = New-Object -TypeName `
Microsoft.Exchange.WebServices.Data.ExchangeService
$id = New-Object -TypeName `
Microsoft.Exchange.WebServices.Data.ImpersonatedUserId `
-ArgumentList "SmtpAddress","dsmith@contoso.com"
$svc.ImpersonatedUserId = $id
$svc.AutoDiscoverUrl("dsmith@contoso.com")
We now have an ExchangeService ...
Read now
Unlock full access