Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Exchange / Checking Read (Unread) Status of Emails in Exchange

February 20, 2023 Exchange

Checking Read (Unread) Status of Emails in Exchange

I have got a case recently: “Can we check an email status (read/unread) regardless of whether the Read Receipt is being enabled or disabled in Outlook, or if a user checked the read receipt?” In this article, we’ll talk about how to track email read status in on-premises Exchange Server and a few words about this feature in Exchange Online (Microsoft 365).

Why may you need to get the email read status?

  • If an email is crucial and you want to make sure that each employee has read it;
  • Many companies use newsletter mailings (like news/birthdays/documents) and you want to get statistics on how effective such mailings are.

Can you have an email read status in an Exchange mailbox regardless of whether a sender requested a read receipt?

Contents:
  • Tracking Read Status of an Email Message in Exchange Server
  • How to Check if a User Has Read an Email in Exchange Online (Microsoft 365)?

Tracking Read Status of an Email Message in Exchange Server

Let’s see how to get an email message read status in an on-prem Exchange Server mailbox. First of all, make sure that email read tracking is enabled in your Exchange organization:

Get-OrganizationConfig | Select ReadTrackingEnabled

True — enabled, false — disabled.

Enable the email read tracking using the command:

Set-OrganizationConfig -ReadTrackingEnabled $true

Only after running the command, read tracking data appear in the Exchange Server logs.

You can disable read status tracking for specific mailboxes (like, service or shared) using the command below:

Set-Mailbox [email protected] -MessageTrackingReadStatusEnabled $false

Then you need to get a message ID using the Get-MessageTrackingLog cmdlet:

Get-MessageTrackingLog -Sender [email protected] -MessageSubject "youremail subject" -Start (Get-Date).AddHours(-48) -EventId RECEIVE | Select MessageID

get message id from Get-MessageTrackingLog

In our example, an email from this sender with a specific subject was sent several times for the last 48 hours. You can apply different filters to get an exact MessageID.
However, you can make it easier: open the email in Outlook, click File — Properties, and find the Message-ID in the Internet Headers section.

excnange message id in outlook internet headers

Then open the Exchange Management Shell and run the Get-MessageReadStatusReport.ps1 (the script code is shown below). Specify a mailbox name and a MessageID.

Get-MessageReadStatusReport powershell

Thus, you get a CSV file with read statuses for the message in all user mailboxes. After an email has been delivered to the mailbox, two statuses are possible:

  • Read – The message is marked as Read in the user’s mailbox
  • Unread – The message is marked as Unread in the user’s mailbox

exchange get message read unread report with powershell

Here is Get-MessageReadStatusReport.ps1 script:
[CmdletBinding()]
param (
[Parameter( Mandatory=$true)]
[string]$Mailbox,
[Parameter( Mandatory=$true)]
[string]$MessageId
)
$output = @()
#Checking Exchange organization read tracking state
if (!(Get-OrganizationConfig).ReadTrackingEnabled) {
throw "Email tracking status is disabled"
}
#Getting an email ID
$msg = Search-MessageTrackingReport -Identity $Mailbox -BypassDelegateChecking -MessageId $MessageId
#There should be one message
if ($msg.count -ne 1) {
throw "$($msg).count emails found with this ID"
}
#Getting a report
$report = Get-MessageTrackingReport -Identity $msg.MessageTrackingReportId -BypassDelegateChecking
#Getting events
$recipienttrackingevents = @($report | Select -ExpandProperty RecipientTrackingEvents)
#Generating a list of recipients
$recipients = $recipienttrackingevents | select recipientaddress
#Getting an email status for each recipient
foreach ($recipient in $recipients) {
$events = Get-MessageTrackingReport -Identity $msg.MessageTrackingReportId -BypassDelegateChecking `
-RecipientPathFilter $recipient.RecipientAddress -ReportTemplate RecipientPath
$outputline = $events.RecipientTrackingEvents[-1] | Select RecipientAddress,Status,EventDescription
$output += $outputline
}
$output
$directory = "C:\PS\ExchangeReports"
$filename = 'ReadStatusReport'
$file = "$filename.csv"
#Exporting the report to CSV
$output | Export-Csv -NoTypeInformation -Append -Path "$directory\$file"

You can download this PowerShell script from my GitHub repo: https://github.com/maxbakhub/winposh/blob/main/Exchange/Get-MessageReadStatusReport.ps1

How to Check if a User Has Read an Email in Exchange Online (Microsoft 365)?

I tried to slightly modify this PowerShell script to get message read status in Exchange Online user mailboxes.

After connecting to my Microsoft 365 tenant using the Exchange Online PowerShell module, I checked to see if email read status tracking was enabled in Exchange Online. By default, messageTrackingReadStatusEnabled was enabled for all mailboxes in the tenant.

Get-EXOMailbox -Properties messageTrackingReadStatusEnabled|select UserPrincipalName,messageTrackingReadStatusEnabled

exchnage online (microsoft 365) get messageTrackingReadStatusEnabled

I edited the script, since the Get-MessageTrace and Get-MessageTraceDetail cmdlets are used for message tracking in Exchange Online instead of Get-MessageTrackingLog and Search-MessageTrackingReport. Unfortunately, Get-MessageTraceDetail in Exchange Online didn’t allow me to get a message status. Microsoft may improve the features of Get-MessageTraceDetail cmdlet to the ones of on-prem Search-MessageTrackingReport in the future, but now it does not work.

So the only way to view the message read status in an Exchange Online mailbox is Microsoft Graph API. You need to check the isRead property of the email (https://docs.microsoft.com/en-us/graph/api/message-get?view=graph-rest-1.0&tabs=http).

0 comment
1
Facebook Twitter Google + Pinterest
previous post
“Could Not Find This Item” While Deleting a File/Folder in Windows
next post
Converting UserAccountControl Attribute Values in Active Directory

Related Reading

PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

October 15, 2023

Configure Email Forwarding for Mailbox on Exchange Server/Microsoft...

September 14, 2023

Find Inactive (Unused) Distribution Lists in Exchange/Microsoft 365

June 26, 2023

Send from Alias (SMTP Proxy Address) in Exchange...

April 6, 2023

How to Use Plus Addressing in Microsoft 365...

April 5, 2023

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Outlook Keeps Asking for Password on Windows
  • How to Manually Configure Exchange or Microsoft 365 Account in Outlook 365/2019/2016
  • Whitelist Domains and Email Addresses on Exchange Server and Microsoft 365
  • Moving Exchange Mailboxes to Different Database
  • FAQ: Licensing Microsoft Exchange Server 2019/2016
  • How to Cleanup, Truncate or Move Log Files in Exchange Server 2013/2016/2019?
  • Search and Delete Emails from User Mailboxes on Exchange Server (Microsoft 365) with PowerShell
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top