Litigation Hold is an Exchange server future that enables us to “freeze” all the mail items that were deleted by the user and keep this mail item in a hidden folder that can be accessed by the Exchange administrator.
In other words, each of the mail items that was deleted by Intentionally or accidentally by the user can be recovered.
The “protection” of deleted mail items will be implemented for all the type of mail items such as calendar, mail, etc.
By default, the deleted mail items will be saved to an unlimited amount of time.
In a scenario of Office 365 and Exchange Online customer, the ability to use the option of Litigation Hold is available only for Office 365 customers that purchased Exchange Online E3 license or Exchange Online Plan 2.
Table of content | Click to expand
PowerShell | Help & additional information
Running PowerShell commands in Office 365 based environment
To be able to run the PowerShell commands specified in the current article, you will need to create a remote PowerShell with Azure Active Directory or Exchange Online. In case that you need help with the process of creating a Remote PowerShell session, you can use the links on the bottom of the Article.
1. Assign Litigation Hold
Assign Litigation Hold to specific recipient (Exchange Online mailbox)
PowerShell command syntax
1 | Set-Mailbox <Identity> -LitigationHoldEnabled $True |
PowerShell command Example
1 | Set-Mailbox John -LitigationHoldEnabled $True |
Assign Litigation Hold to a specific recipient (Exchange Online mailbox) + define time range (7 years)
PowerShell command syntax
1 | Set-Mailbox <Identity> -LitigationHoldEnabled $True -LitigationHoldDuration <time range > |
PowerShell command Example
1 | Set-Mailbox John -LitigationHoldEnabled $True -LitigationHoldDuration 2555 |
Assign Litigation Hold to all of the Exchange Online recipients (Bulk mode)
PowerShell command Example
1 | Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | Set-Mailbox -LitigationHoldEnabled $True |
Assign litigation Hold to Exchange Online recipients (Bulk mode) based on a criterion | Department
PowerShell command syntax
1 | Get-Recipient -RecipientTypeDetails UserMailbox -ResultSize unlimited -Filter '(Department -eq "<Department>")' | Set-Mailbox -LitigationHoldEnabled $True |
PowerShell command Example
1 | Get-Recipient -RecipientTypeDetails UserMailbox -ResultSize unlimited -Filter '(Department -eq "Marketing")' | Set-Mailbox -LitigationHoldEnabled $True |
Assign litigation Hold to Exchange Online recipients that don’t have Litigation Hold
PowerShell command Example
1 2 | Get-Mailbox | Where {$_.LitigationHoldEnabled -match "False"} | ForEach-Object { $Identity = $_.alias; Set-Mailbox -Identity $Identity -LitigationHoldEnabled $True } |
2. Display information about Litigation Hold
Display information about specific recipient which his mailbox has Litigation Hold
PowerShell command syntax
1 | Get-Mailbox <Identity> | FL LitigationHold* |
PowerShell command Example
1 | Get-Mailbox John | FL LitigationHold* |
Display information about all of the mailboxes which have Litigation Hold
PowerShell command syntax
1 | xxxx |
PowerShell command Example
1 | Get-Mailbox -ResultSize Unlimited | FL LitigationHold* |
Display information about User mailboxes which has Litigation Hold using the filter operator
PowerShell command Example
1 | Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | FL Name,LitigationHold* |
Display information about User mailboxes which has Litigation Hold using the Where operator
PowerShell command Example
1 | Get-Mailbox | Where {$_.LitigationHoldEnabled -match "True"} | FL Name,LitigationHold* |
Display information about User mailboxes which doesn’t have Litigation Hold
PowerShell command Example
1 | Get-Mailbox | Where {$_.LitigationHoldEnabled -match "False"} | FL Name,LitigationHold* |
Display information about mailboxes which have Litigation Hold | information about the recoverable items folder.
PowerShell command Example
1 | Get-Mailbox -ResultSize Unlimited -Filter {LitigationHoldEnabled -eq $true} | Get-MailboxFolderStatistics –FolderScope RecoverableItems | Format-Table Identity,FolderAndSubfolderSize -Auto |
3. Remove Litigation Hold
Remove Litigation Hold to specific recipient (Exchange Online mailbox)
PowerShell command syntax
1 | Set-Mailbox <Identity> -LitigationHoldEnabled $False |
PowerShell command Example
1 | Set-Mailbox John -LitigationHoldEnabled $False |
Header
PowerShell command syntax
1 | xxxx |
PowerShell command Example
1 | Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | Set-Mailbox -LitigationHoldEnabled $False |
For your convenience, I have “Wrapped” all the PowerShell commands that were reviewed in the article,
in a “Menu Based” PowerShell Script.
You are welcome to download the PowerShell script and use it.
Getting started with Office 365 PowerShell
Get more information about the Naming Conventions that are used in the PowerShell articles – Help and additional information – o365info.com PowerShell articles
To get more information about the required remote PowerShell commands that you need to use for connecting to Exchange Online, read the following article:
Connect to Exchange Online by using Remote PowerShell
To get more information about the required software component + the remote PowerShell commands that you need to use for connecting Azure Active Directory, read the following article: Part 2: Connect to Office 365 by using Remote PowerShell
If you are new in the PowerShell world, you can read more information about how to start working with PowerShell in Office 365 based environment in the following article series: Getting started with Office 365 PowerShell – Part 1, Part 2, Part 3.
In case that you need more information about how to use the o365info PowerShell scripts that I add to the PowerShell articles, you can read the article – How to run and use o365info PowerShell menu script
It is important for us to know your opinion on this article

