'How can I change the time that an e-mail was received via Microsoft Exchange Server or Microsoft Outlook?
As the question says, how can I change the time that an e-mail was received either via Microsoft Outlook or via Microsoft Exchange Server (as an Administrator account) directly?
There are numerous GUI tools online that plug in to Microsoft Outlook and allow you to change various things (including the received date/time) of an e-mail, and these changes are then pushed back to the server.
My question though concerns how to do such without these shareware GUI tools that are available online i.e. directly through Microsoft Outlook or Microsoft Exchange Server (as an Administrator account) using PowerShell or the like.
Solution 1:[1]
Outlook Object Model exposes the MailItem.ReceivedTime
and MailItem.SentOn
properties. Unfortunately they are read-only, even though your can change these properties using Extended MAPI (C++ or Delphi only) - the properties are PR_MESSAGE_DELIVERY_TIME
and PR_CLIENT_SUBMIT_TIME
respectively. Worse than that, OOM has an annoying habit of updating the ReceivedTime
property every time MailItem.Save
is called.
Note that creation and last modification dates cannot be changed using any API - these values are automatically updated by the store provider.
You can manually modify PR_MESSAGE_DELIVERY_TIME
and PR_CLIENT_SUBMIT_TIME
properties using OutlookSpy (I am its author) - select the message, click the IMessage button, double click on these properties to edit them.
If using Redemption (any language, I am its author) is an option, it allows to modify these properties. The following VB script will update the dates of the currently selected message in Outlook:
TheDate = #2015/12/01 2:00 pm#
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set Item = Session.GetMessageFromID(Application.ActiveExplorer.Selection(1).EntryID)
Item.ReceivedTime = TheDate
Item.SentOn = TheDate
Item.Save
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Dmitry Streblechenko |