July 2017
Intermediate to advanced
648 pages
31h 9m
English
Let's take a look at how we could use impersonation using a modified version of the Send-EwsMailMessage function, included in the Sending email messages with EWS recipe earlier in this chapter. Add the following function to your shell session:
function Send-EWSMailMessage { param( [Parameter( Position=0, Mandatory=$true, ValueFromPipelineByPropertyName=$true )] [String[]] $PrimarySmtpAddress, [Parameter( Position=1, Mandatory=$true )] [String] $From, [Parameter( Position=2, Mandatory=$true )] [String] $Subject, [Parameter( Position=3, Mandatory=$true )] [String] $Body, [Parameter( Position=4, Mandatory=$false )] [String[]] $Cc, [Parameter( Position=5, Mandatory=$false )] [String[]] $Bcc ) begin { Add-Type -Path C:\EWS\Microsoft.Exchange.WebServices.dll ...Read now
Unlock full access