Script to find the true READ status of an Email message

This script uses EWS API and Powershell to find the true READ status of an email message.

 
 
 
 
 
(0)
1,374 times
Add to favorites
Exchange
6/3/2017
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Not searching in other folders?
    1 Posts | Last post June 26, 2019
    • Hi Santhosh,
      
      Script is running fine except for if a user moved the email to another folder it throws the not present in mailbox error?
      
      Please advise
      
      Thanks
  • Unauthorised
    1 Posts | Last post June 19, 2019
    • Hi Santhosh,
      
      I am running the script using the credentials of a global admin, however i am getting: 
      
      "The request failed. The remote server returned an error: (401) Unauthorized." ---> Microsoft.Exchange.WebServices.Data.ServiceRequestException: The request failed. The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
      
      Any advice? I looked into impersonation, is this something i need to set up?
      
      Thanks
  • What is the script actually doing?
    1 Posts | Last post January 25, 2019
    • Looking through your code, you're pulling the PR_MESSAGE_FLAGS and doing a binary AND operation against the value 0x0400.  The value 0x0400 corresponds to the SUBMIT flag, while the value 0x0100 corresponds to the Read flag, which I assume is what the predefined IsRead property is checking against.
      
      I guess my confusion is how 0x400 (SUBMIT) relates to whether a message has ever been read.  Clarify?
  • get-readstatus is not recognized
    3 Posts | Last post August 11, 2018
    • Hi Santhosh - thanks for the script.  This will be very useful as we are trying to figure out if users are reading emails sent by the CEO.  I am running into this error... any insight would be much appreciated.  thanks.
      
      Get-ReadStatus : The term 'Get-ReadStatus' is not recognized as the name of a cmdlet, function, script file, or
      operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
      again.
      At C:\ReadIt\whoreadit.ps1:17 char:27
      +                $Result += Get-ReadStatus –Emailaddress $MailboxName -Credential  ...
      +                           ~~~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (Get-ReadStatus:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
    • it was my bad.. got it. thanks.
    • Sorry about the delayed response, but Glad you fixed it on your own :)
  • CSV returning nothing
    2 Posts | Last post August 11, 2018
    • Hey Santhosh,
      
      Awesome script. I ran it last week. However, running it again now (with the same parameters) I am getting an empty CSV. Any thoughts?
      
    • Hey Gangsta, Could you please run the script with -Verbose switch, Empty CSV is not expected in any case here
      thanks
  • Error when running script.
    3 Posts | Last post August 11, 2018
    • I ran this script and it kind of worked, few recipients threw this error:
      
      First run:
      
      CSV FILE:
      ,,,,"System.Management.Automation.RuntimeException: Item not present in Mailbox: "user@domain.com"
      
      PowerShell Error: 
      Exception calling "Delete" with "1" argument<s>: "Object cannot be deleted.".
      
      Second run:
      
      "DateTimeReceived","Subject","IsEverRead","IsRead","Error","Sender","Mailbox"
      ,,,,"System.Management.Automation.MethodInvocationException: Exception calling ""Save"" with ""1"" argument(s): ""A folder with the specified name already exists."" ---> Microsoft.Exchange.WebServices.Data.ServiceResponseException: A folder with the specified name already exists.
         at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()
         at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
         at Microsoft.Exchange.WebServices.Data.Folder.Save(FolderId parentFolderId)
         at CallSite.Target(Closure , CallSite , Object , Object )
         --- End of inner exception stack trace ---
         at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
         at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
         at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
         at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)",,"user@domain.com
      
      We are running Exchange 2013 CU21 on-premise, hybrid.
      
      Any ideas?
    • Does the script handle reporting read status on messages that have already been read and deleted from the user's inbox and recycling bin? Given it throws "Item not present in mailbox" it probably expects the email message to NOT be deleted?
    • Hi Techy86,
      The script searches for the message to fetch a Mapi property on the message to determine if it is Ever read or not. If the message is deleted from Mailbox, script cannot report the status.
      Regarding the error, it looks like the script is unable to delete the search folder it created, the folder is created on Top of the Information store and it is named 'TEMP-MSG-ID'. For the mailboxes it failed on the second run, can you try deleting the folder manually using MFCMAPI? Also, before you run the script, please check why the folder wasnt deleted in the first place.
      
      thanks