Restoring Deleted mail items using the PowerShell cmdlet Restore-RecoverableItems | 3#3 5/5 (2) 5 min read

In the current article, we review the use of the PowerShell cmdlet – Restore-RecoverableItems.

Restore deleted mail items to their original folder using PowerShell| The article series

The article series includes the following articles:

The purpose of the PowerShell cmdlet – Restore-RecoverableItems is to help us to restore deleted mail items in their original folder. As mentioned in the former article, the uniqueness of the PowerShell cmdlet – Restore-RecoverableItems is the ability to restore Deleted mail items to their original folder (the folder that stored the mail items before they have been deleted).

Quick reminder and reference

In the former article, we review the use of the PowerShell cmdlet – Get-RecoverableItems that help us to display information about the delete mail items of a specific Exchange mailbox.

In the context of the PowerShell cmdlets Get-RecoverableItems and Restore-RecoverableItems
, the term “deleted mail items” refers to two types of deleted mail items:

  1. Standard Deleted items – the term “standard deleted mail items” is not a formal technical term, but instead, I term which I use for relating to regulated mail items that are stored in the mailbox folder – “Deleted items” (the mailbox recycle bin).
  2. Soft Deleted mail items – mail items that were deleted from the mailbox recycle bin and classified as “Soft Deleted mail items.” These mail items are stored in the “Deletion” folder, a special hidden system folder, that is part of the “Recoverable item folderspace and store Soft Deleted mail items.

Restore Deleted mail items | Filter by – Folder scope

In case that we use the PowerShell cmdlet Restore-RecoverableItems as it is, without any folder scope parameters, the Restore-RecoverableItems cmdlet will automatically restore all the following types of deleted mail items:

  • Standard Deleted items
  • Soft Deleted mail items

In case that we use the PowerShell cmdlet Restore-RecoverableItems without any folder scope, the cmdlet will automatically restore the two type of deleted mail items.

PowerShell command example

Using “Folder scope” for restoring specific type of deleted mail items
To be able to perform a restore procedure that related only to specific types of “deleted mail,” we use the parameter “SourceFolder.”

The structure of the PowerShell command is written as follows:

Restore only standard Deleted mail items (Deleted items stored in recycling bin)

To restore only “standard Deleted mail items,” meaning mail items that are stored in the “Deleted items” folder, we need to use the following PowerShell command syntax:

Restore only Soft Deleted mail items.

To restore only “Soft Deleted mail items,” meaning mail items that are stored in the “Deletion” folder (sub-folder in the “Recoverable item folder” space), we need to use the following PowerShell command syntax:

Restore Deleted mail items | Filter by – Date

To restore deleted mail items from a specific date range, we use the following 2 PowerShell parameters:

  • FilterStartTime
  • FilterEndTime

PowerShell command syntax example:

Restore Deleted mail items | Filter by – E-mail message subject

To restore deleted mail items that have a specific text string in their subject, we can use the parameter –   SubjectContains

PowerShell command syntax example:

Restore Deleted mail items | Filter by – E-mail message type

Exchange mailbox serves as a container for various types of “mail items.”
For example, standard E-mail message, calendar meeting, task items and mail contact item.

When we ask to restore deleted mail items, the PowerShell cmdlet Restore-RecoverableItems will automatically restore all the type of mail items, that’s considered as “deleted mail items.”
In case that we need to define a search filter that looks for a specific type of deleted mail items, we can use the parameter “FilterItemType”.
The following table displays the 4 types of “mail item”:

E-mail message IPM.Note
Contact IPM.Contact
Calendar item IPM.Appointment
Task item IPM.Task

For example, in case that we want to restore only deleted mail items that considered as “calendar mail items”, we can use the following syntax:

Restore Deleted mail items | Filter by – Number of deleted mail items

By default, the PowerShell cmdlet Restore-RecoverableItems will restore all the deleted mail items.
In case that we want to ask to restore only a specific amount of deleted mail items, we can use the parameter – ResultSize

For example, we want to restore only the last 5 mail items that classified as “Deleted mail items.”

Restore-RecoverableItems Jeff -ResultSize 5

Restore Deleted mail items | Filter by – Last parent folder id

The term “Last parent folder identity,” define the identity of the Exchange mailbox folder that hosts the mail items before the mail items were deleted.

The “Last parent folder identity” appears is a property named – LastParentFolderID
In case that we need to define a scenario in which we want to restore only specific deleted mail items, which were located in a specific folder, we can use the parameter –  LastParentFolderID

For example

Restorer mail items | Additional options

Measure the estimated time that is needed to restore mail items


Now it’s Your Turn!
It is important for us to know your opinion on this article

Related Post

Please rate this

Eyal Doron on EmailEyal Doron on FacebookEyal Doron on GoogleEyal Doron on LinkedinEyal Doron on PinterestEyal Doron on RssEyal Doron on TwitterEyal Doron on WordpressEyal Doron on Youtube
Eyal Doron
Share your knowledge.
It’s a way to achieve immortality.
Dalai Lama

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.