Need a windows powershell code to get a report of all delivered emails

ANINDITA PAUL
ANINDITA PAUL used Ask the Experts™
on
I am trying to send reminder mails all customers with outstanding balance. To automate that I have created a powershell code which read email IDs and balance amounts from an excel and send email notifications to them. This is already achieved.

My next requirement is to include a code in that script or in any other way by which I get a report of which all mails are delivered to the recipient and then we can see which recipient has read their mail.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
System Engineer
Commented:
2nd part of requirement is highly unreliable. To see if a recipient read their email you need to assume that

1] Everyone acknowledges read receipts
2] No one has auto read receipts enabled, to avoid marking unread mails as read by accident when mouse clicks on the mail in inbox.

You might as well focus on delivery receipts and do away with the second part.
I found the below bit of code here, but I cannot guarantee that this works, as I have not tested it.

Get-ExchangeServer | where {$_.IsHubTransportServer -eq “true”} | Get-MessageTrackingLog -Recipients:undergraduatestudents@domain.edu -EventId “RECEIVE” | select TimeStamp,Sender,{$_.recipients},MessageSubject | Export-Csv C:\undergraduatestudents.csv

Open in new window


If you really want the second part, I'd refer to this article here to take the bits you want from the code and trial it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial