Site icon Franky's Web

Exchange ReadTracking: Has a mail already been read?

From time to time it happens that a Remove mail from the mailboxes for example because the email should not have been sent in this way. Experience has shown that this often happens with internal newsletters. The question often arises as to whether the mail has already been read, and if so, by how many recipients. With Exchange servers, ReadTracking can be activated for this purpose, allowing you to check for each recipient of an email whether the email has been marked as read in the mailbox.

The ReadTracking feature is not activated by default and must therefore be activated first:

Set-OrganizationConfig -ReadTrackingEnabled $true

The above command activates ReadTracking for all new mails, so the read status of mails sent before activation cannot be checked.

Wenn das ReadTracking aktiviert wurde, können auch Benutzer auf den so erzeugten Zustellbericht zugreifen. In Outlook findet sich dazu bei einer gesendeten Mail die Schaltfläche „Nachrichtenzustellbericht“:

The button opens the browser and retrieves the delivery report in OWA, here is an example of a delivery report from the sender's point of view:

The delivery report contains information on every recipient, ReadTracking only works within the Exchange organization. It is therefore not possible to check whether an external recipient has read the mail in this way.

With the Exchange Shell, however, admins also have the option of querying the read status for a mail. For this to work, this small PowerShell function is required first:

function Get-MessageReadEvents{
	Param(
		[parameter(Mandatory=$true,Position=1)]
		[string]$Mailbox,
		[parameter(Mandatory=$true,Position=1)]
		[string]$MessageId
		)

	$Message = Search-MessageTrackingReport -Identity $Mailbox -MessageId $MessageID -BypassDelegateChecking

	$TrackingReport = Get-MessageTrackingReport -Identity $Message.MessageTrackingReportId -BypassDelegateChecking
	$RecipienttrackingEvents = @($TrackingReport | Select -ExpandProperty RecipientTrackingEvents)

	$ReadEvents = @()
	$Recipients = $RecipienttrackingEvents | select RecipientAddress
	foreach ($Recipient in $Recipients) {
		$Events = Get-MessageTrackingReport -Identity $Message.MessageTrackingReportId -BypassDelegateChecking -RecipientPathFilter $Recipient.RecipientAddress -ReportTemplate RecipientPath
		$ReadEventsline = $Events.RecipientTrackingEvents[-1] | Select RecipientAddress,Status,EventDescription
		$ReadEvents += $ReadEventsline
	}
	return $ReadEvents
}

The function can simply be added to the Exchange Shell:

Jetzt ist die Funktion „Get-MessageReadEvents“ verfügbar. „Get-MessageReadEvents“ erwartet als Parameter den Absender und die MessageID der Mail für die der Zustellbericht angezeigt werden soll, hier mal ein Bespiel für eine ungelesene Mail:

Once the mail has been marked as read, this is also shown in the ReadTracking report:

The MessageID can be read from the MessageTracking logs using the following command, for example:

Get-MessageTrackingLog -Sender frank@frankysweb.de -Start (get-date).AddMinutes(-10) -EventId Send | fl sender,recipients,messagesubject,messageid

The ReadTracking Report can then be queried using the sender and the MessageID:

Get-MessageReadEvents -Mailbox frank@frankysweb.de -MessageId e3b6194a63a241dc8ea207cc31d7c84f@frankysweb.de

More examples of message tracking can be found in the following articles:

Exit mobile version