Office 365 Powershell to Check if Message Read
Shiva asks whether there is a way to make up one's mind if the recipients of an email have read the email message or not.
Bulletin tracking searches already gives u.s. the ability to determine whether an email bulletin was delivered, merely not whether the detail has been read all the same. To find that out, we need to look at delivery reports.
Delivery reports are available in Commutation organizations, only read tracking is not enabled by default. You can check whether read tracking is enabled in your arrangement with the Get-OrganizationConfig cmdlet.
[ PS ] C : \ > Get - OrganizationConfig | Select ReadTrackingEnabled ReadTrackingEnabled : False |
If read tracking isn't already enabled, and so you won't be able to track the read status of letters that accept already been sent. If y'all'd like to be able to track the messages in future, turn it on now.
[ PS ] C : \ > Gear up - OrganizationConfig - ReadTrackingEnabled $ true |
There is also a per-mailbox setting. Past default, read tracking is enabled for mailboxes, then in one case you take turned it on for the organization it will work for all of your mailboxes. Only, some mailboxes might be sensitive and need to be excluded from these types of searches. In that instance, yous tin use Set-Mailbox to disable read condition tracking for those mailboxes.
[ PS ] C : \ > Fix - Mailbox john . smythe @ contoso . com - MessageTrackingReadStatusEnabled $ faux |
Now let's look at an example of reporting on the read condition of an email. To kickoff with, it helps to know the message ID. 1 of the ways you tin retrieve this is with a message tracking log search. Consider a scenario in which the user Mike Nash has sent a company newsletter to all staff within the terminal 48 hours. Nosotros can search message tracking logs for that message, and return the message ID.
[ PS ] C : \ > Get - MessageTrackingLog - Sender mike . nash @ contoso . com - MessageSubject "Company newsletter" - Showtime ( Go - Date ) . AddHours ( - 48 ) - EventId RECEIVE | Select MessageID MessageId -- -- -- -- - & lt ; b4699b83d1084712b2b746582ceedc15 @ contoso . com & gt ; |
Next, we tin can perform a message tracking report search for Mike's mailbox using Search-MessageTrackingReport. For convenience, capture the results into a variable.
[ PS ] C : \ > $ msg = Search - MessageTrackingReport - Identity mike . nash @ contoso . com - BypassDelegateChecking - MessageId b4699b83d1084712b2b746582ceedc15 @ contoso . com [ PS ] C : \ > $ msg . count 1 |
As you tin see, past searching for the message ID, we get ane issue, rather than needing to filter through multiple results. Merely we're not there all the same, so far the information that has been retrieved doesn't provide the answer we want.
[ PS ] C : \ > $ msg RunspaceId : 2dca05a6 - 56a9 - 4c0e - 9c83 - de6bc08bb5f0 MessageTrackingReportId : Bulletin - Id =& lt ; b4699b83d1084712b2b746582ceedc15 @ contoso . com & gt ; , Server = ny - exch01 . contoso . com , Intern al - Id = 0 , Sender = 1f67d9e7 - 982c - 4b1e - 878f - 3e55f947b5e1 , Domain = contoso . com SubmittedDateTime : vi / nine / 2016 6 : 31 : 01 AM Subject : Email to all staff FromAddress : Mike . Nash @ contoso . com FromDisplayName : Mike Nash RecipientAddresses : { AllStaff @ contoso . com } RecipientDisplayNames : { All Staff } Identity : IsValid : True ObjectState : New |
Next, retrieve a delivery report by running Get-MessageTrackingReport for that message tracking report ID that has been returned in the search results. Again, capture the results in a variable for ease of handling.
[ PS ] C : \ > $ report = Get - MessageTrackingReport - Identity $ msgs . MessageTrackingReportId - BypassDelegateChecking |
Now take a await at the report.
1 2 3 4 5 vi vii 8 9 10 11 12 13 xiv 15 sixteen 17 18 19 twenty 21 22 23 24 25 26 27 28 29 thirty 31 32 33 34 35 | [ PS ] C : \ > $ study RunspaceId : 2dca05a6 - 56a9 - 4c0e - 9c83 - de6bc08bb5f0 MessageTrackingReportId : Bulletin - Id =& lt ; b4699b83d1084712b2b746582ceedc15 @ contoso . com & gt ; , Server = ny - exch01 . contoso . com , Intern al - Id = 0 , Sender = 1f67d9e7 - 982c - 4b1e - 878f - 3e55f947b5e1 , Domain = contoso . com SubmittedDateTime : vi / nine / 2016 6 : 31 : 01 AM Subject : Email to all staff FromAddress : Mike . Nash @ contoso . com FromDisplayName : Mike Nash RecipientAddresses : { AllStaff @ contoso . com } RecipientDisplayNames : { All Staff } DeliveredCount : 25 PendingCount : 0 UnsuccessfulCount : 0 TransferredCount : 0 RecipientTrackingEvents : { Apurva . Dalia @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Jim . Daly @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Ryan . Danner @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : ten.1460000Z , Mike . Danseglio @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : ten.1460000Z , Alex . Darrow @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Shannon . Dascher @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : ten.1460000Z , WillsonRaj . David @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Dan . Bound @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Michael . Jurek @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Reto . Kch @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Dalibor . Kacmar @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : x.1460000Z , Wendy . Kahn @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Sandeep . Kaliyath @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Mandar . Naik @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Ranjith . Narayanan @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z , Mike . Nash @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : 10.1460000Z... } Identity : IsValid : True ObjectState : New |
The recipient tracking events are what we can use to determine who has opened the email bulletin. Here's one of the results from that list.
[ PS ] C : \ > $ report . RecipientTrackingEvents [ 0 ] Appointment : 6 / 9 / 2016 6 : 31 : 10 AM RecipientAddress : Apurva . Dalia @ contoso . com RecipientDisplayName : Apurva Dalia Status : Delivered EventType : Evangelize EventDescription : The bulletin was successfully delivered . EventData : Server : Identity : IsValid : True ObjectState : New |
Then from a reporting perspective, the RecipientDisplayName and Status fields are of most interest.
1 ii 3 four five vi 7 viii 9 10 11 12 13 fourteen fifteen 16 17 18 19 twenty 21 22 23 24 25 26 27 28 29 | [ PS ] C : \ > $ study . RecipientTrackingEvents | Select RecipientDisplayName , Status RecipientDisplayName Status -- -- -- -- -- -- -- -- -- -- -- -- -- Apurva Dalia Delivered Jim Daly Delivered Ryan Danner Delivered Mike Danseglio Delivered Alex Darrow Delivered Shannon Dascher Delivered WillsonRaj David Delivered Dan Jump Delivered Michael Jurek Delivered Reto Thouäch Delivered Dalibor Kacmar Delivered Wendy Kahn Delivered Sandeep Kaliyath Delivered Mandar Naik Delivered Ranjith Narayanan Delivered Mike Nash Delivered KirkJ . Nason Delivered Mrina Natarajan Delivered Dave Natsuhara Delivered Marker Steele Delivered Heidi Steen Delivered Kim Steffensen Delivered Victor Stehmann Delivered Alan Steiner Delivered Jaka Stele Delivered |
Now, I know the results to a higher place are not correct, because I have read the message using OWA while logged on with at least one of those accounts. And in fact, nosotros can cheque the read status for a single recipient, by appending the -RecipientFilterPath and -ReportTemplate parameters.
1 2 3 4 5 six seven 8 9 ten 11 12 13 14 xv 16 17 18 xix 20 21 22 23 | [ PS ] C : \ > Get - MessageTrackingReport - Identity $ msg . MessageTrackingReportId - BypassDelegateChecking - RecipientPathFilter jim . daly @ contoso . com - ReportTemplate RecipientPath RunspaceId : 2dca05a6 - 56a9 - 4c0e - 9c83 - de6bc08bb5f0 MessageTrackingReportId : Message - Id =& lt ; b4699b83d1084712b2b746582ceedc15 @ contoso . com & gt ; , Server = ny - exch01 . contoso . com , Intern al - Id = 0 , Sender = 1f67d9e7 - 982c - 4b1e - 878f - 3e55f947b5e1 , Domain = contoso . com SubmittedDateTime : ane / ane / 0001 12 : 00 : 00 AM Subject field : FromAddress : FromDisplayName : RecipientAddresses : { } RecipientDisplayNames : DeliveredCount : 0 PendingCount : 0 UnsuccessfulCount : 0 TransferredCount : 0 RecipientTrackingEvents : { AllStaff @ contoso . com , Submitted , , 2016 - 06 - 09T06 : 31 : 01.0710000Z , Jim . Daly @ contoso . com , Expanded , , 2016 - 06 - 09T06 : 31 : 02.2970000Z , Data = AllStaff @ contoso . com ; All Staff , Jim . Daly @ contoso . com , Delivered , , 2016 - 06 - 09T06 : 31 : ten.1460000Z , Jim . Daly @ contoso . com , Read , , 0001 - 01 - 01T00 : 00 : 00.0000000 } Identity : IsValid : Truthful ObjectState : New |
The recipient tracking events in that output evidence that Jim has read the message.
Now what about checking for all of the recipients? Well we can exercise that besides, by looping through the results with a bit of PowerShell. In my case, the variable $study already exists from when I ran Become-MessageTrackingReport earlier, so I can now run:
$ recipienttrackingevents = @ ( $ report | Select - ExpandProperty RecipientTrackingEvents ) $ recipients = $ recipienttrackingevents | select recipientaddress foreach ( $ recipient in $ recipients ) { $ events = Go - MessageTrackingReport - Identity $ msg . MessageTrackingReportId - BypassDelegateChecking ` - RecipientPathFilter $ recipient . RecipientAddress - ReportTemplate RecipientPath $ events . RecipientTrackingEvents [ - 1 ] | Select RecipientAddress , Condition , EventDescription } |
The output of those commands looks similar this:
1 2 3 4 five 6 seven viii nine 10 11 12 thirteen 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | RecipientAddress Condition EventDescription -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Apurva . Dalia @ contoso . com Delivered Unread - The message is marked as Un . . . Jim . Daly @ contoso . com Delivered Read - The message is marked every bit Read . . . Ryan . Danner @ contoso . com Delivered Unread - The bulletin is marked equally Un . . . Mike . Danseglio @ contoso . com Delivered Unread - The message is marked as United nations . . . Alex . Darrow @ contoso . com Delivered Unread - The message is marked as Un . . . Shannon . Dascher @ contoso . com Delivered Unread - The message is marked as Un . . . WillsonRaj . David @ contoso . com Delivered Unread - The message is marked as Un . . . Dan . Jump @ contoso . com Delivered Unread - The message is marked equally Un . . . Michael . Jurek @ contoso . com Delivered Unread - The bulletin is marked every bit Un . . . Reto . Kch @ contoso . com Delivered Unread - The bulletin is marked every bit United nations . . . Dalibor . Kacmar @ contoso . com Delivered Unread - The message is marked as Un . . . Wendy . Kahn @ contoso . com Delivered Unread - The message is marked as Un . . . Sandeep . Kaliyath @ contoso . com Delivered Unread - The message is marked as Un . . . Mandar . Naik @ contoso . com Delivered Unread - The bulletin is marked every bit Un . . . Ranjith . Narayanan @ contoso . com Delivered Unread - The message is marked as United nations . . . Mike . Nash @ contoso . com Delivered Read - The message is marked every bit Read . . . KirkJ . ? Nason @ contoso . com Delivered Unread - The message is marked as Un . . . Mrina . Natarajan @ contoso . com Delivered Unread - The message is marked equally Un . . . Dave . Natsuhara @ contoso . com Delivered Unread - The message is marked every bit Un . . . Marker . Steele @ contoso . com Delivered Unread - The bulletin is marked as United nations . . . Heidi . Steen @ contoso . com Delivered Unread - The message is marked as United nations . . . Kim . Steffensen @ contoso . com Delivered Unread - The message is marked equally Un . . . Victor . Stehmann @ contoso . com Delivered Unread - The message is marked as Un . . . Alan . Steiner @ contoso . com Delivered Unread - The bulletin is marked as Un . . . Jaka . Stele @ contoso . com Delivered Unread - The message is marked as Un . . . |
Success! Sort of… fifty-fifty though I accept the issue, information technology'southward not all that convenient. So allow's wrap it all up into a short script, called Get-MessageReadStatusReport.ps1 (GitHub). Hither's how it looks:
So there you are, tracking the read status of messages in your organization. This assumes that you've turned on read status tracking for the arrangement, and that information technology isn't disabled for 1 or more than of the mailboxes you're interested. There's a few other caveats besides:
- Opening a message and actioning a bulletin are two different things. Someone might open your bulletin, but information technology doesn't mean they've done what you desire them to practise (e.chiliad. replied, clicked a link, filled out a course, etc)
- Outlook and OWA mark messages read when they are selected. And then read status doesn't always mean a human has looked at the message.
- An unread message sitting in the inbox, and an unread message that has been deleted, will exist duplicate from each other when you expect at commitment reports
Office 365 Powershell to Check if Message Read
Source: https://practical365.com/tracking-read-email-messages-exchange-server/
Postar um comentário for "Office 365 Powershell to Check if Message Read"