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:

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).

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 folder” space 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

1

Restore-RecoverableItemsJeff

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.”

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:

1

Restore-RecoverableItemsJeff-SourceFolderDeletedItems

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:

1

Restore-RecoverableItemsJeff-SourceFolderRecoverableItems

Restore Deleted mail items | Filter by – Date

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

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

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:

1

Restore-RecoverableItemsJeff-FilterItemTypeIPM.Appointment

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