Partilhar via


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.

Here’s another script I created for one of my customer with such requirement. This is an EWS PowerShell script that is used to find the “True” read status of an email message.

Below is the report Generated from the script.

To automate the complete solution, you could create a script, but it is not in scope of this blog post.

  • Use Get-Messagetrackinglog and/or Get-Messagetrace (if you are in Hybrid, you will need to track both) to collect the recipients details to whom the message was delivered to.
  • Use an account that has Impersonation permissions on On-perm and Online if you are in Hybrid, and use it with this script to find the read status of the given Message. Something like below..

Get-ReadStatus is the function exported by the script. The script can be used against On-perm or Online mailboxes to find the Read / Unread status of an email message. The function returns a Custom Object with the READ status of the email. It first searches for the email message in the Inbox of the target mailbox with provided Search filters and if not found, it searches the Entire Mailbox using Search folders.

After reading the message, user may mark the message as 'UnRead' to review it later. This script retrieves the 'EverRead' status, an extended MAPI property value to report the Read Status of the message.

Features:

  • Uses Autodiscover to find the EWS URL, but for increased performance, one can specify the EWSUrl parameter manually.
  • Can be used against Office 365 or On-Perm mailbox. If the Email message was sent to Online and On-Perm mailboxes, use an account that has impersonation permissions on both org for easy tracking.
  • Searches Inbox first and if the message is not found in the Inbox Folder, then the script searches the entire mailbox.
  • Error message is returned on the result object, no separate log file parsing is required to find the complete status

Prerequisite   :  Requires Powershell V3 or Higher.

                       :  Requires EWS API 1.2 or higher installed on the machine.

 

Please leave a comment if you find it useful or for any questions.

Comments

  • Anonymous
    October 20, 2017
    Useful Script !