Loading...

EWS Powershell Script to find the ‘True’ Read Status of an email message.

Some business requires to track the READ status of some critical messages that was sent to all or some of the users. They want to know if the email was delivered to the Mailbox and was read by the user.

Grab the script from: https://blogs.technet.microsoft.com/santhse/get-readstatus/

If you are running on-premise, use:

$credentials = Get-Credential
$messageID = ‘[email protected]’
$URL = ‘https://webmail.domain.com/EWS/Exchange.asmx’

#$EmailAddress = Get-Content C:\temp\EmailAddress.txt
$EmailAddress = Get-Messagetrackinglog -MessageId $MessageID -EventID Deliver | select -ExpandProperty Recipients
$Result = @()
[INT]$Total = $EmailAddress.Count
[INT]$i = 0

ForEach($Address in $EmailAddress) {
$i++
Write-Progress -Activity "Processing $Address "
$MailboxName = $Address
$Result += Get-ReadStatus –Emailaddress $MailboxName -Credential $credentials -Impersonate -EWSUrl $URL -MessageID $MessageID -startdate 07/30/2018 -enddate 08/02/2018
}

$Result | Export-Csv C:\Temp\Readstatus.csv -NoTypeInformation

Make sure the user you are passing into Get-Credential has ApplicationImpersonation role assigned.

Run the script using the Exchange Management Shell locally from the Exchange server to avoid having to install EWS Managed API.

Save the script as GetReadStatus.ps1 and the snippet as GetReadStatusRun.ps1 and simply run from EMS as: Import-Module GetReadStatus.ps1 && GetReadStatusRun.ps1

Leave a Comment

Your email address will not be published.

Cookies help us deliver our services. By using our services, you agree to our use of cookies. More Information