Enable Litigation Hold in Office 365 Using PowerShell

Enable Litigation Hold in Office 365 Using PowerShell

Organizations must retain all the emails, calendars, etc., including the deleted items related to specific individuals’ for security purposes and future case investigations. You may think that how to retain all the emails even if it gets deleted from outlook? Thus, Microsoft enables litigation hold in Office 365 to retain the modified email messages and deleted mailbox items from the Recoverable Items folder. All you need is to place the litigation hold on specific mailboxes, all users, or groups based on your requirements.

Let us see how we can manage the litigation hold in Office 365 in this article. 

 

What is Office 365 Litigation Hold? 

Litigation holds are a way to retain deleted mailbox items and the original versions of modified contents. You can place both a time-based hold and infinite hold for any mailbox.

Placing mailboxes on hold can help the organization in legal case investigations. Thus, it is necessary to retain electronically stored information (ESI) like emails, calendar items, etc., in the organization. 

License Requirements to Place Mailboxes on Litigation Hold: 

Admins will frequently encounter the below error while placing a mailbox on hold. 

Your Microsoft Exchange Online license doesn’t permit you to put a litigation hold on this mailbox. 

Generally, this occurs due to insufficient license plans in the organization. To place a user mailbox on litigation hold, they must have one of the following licensing plans: 

  • Exchange Online Plan 2  
  • Microsoft 365 E3  
  • Microsoft 365 E5  
  • Office 365 E3  
  • Office 365 E5 

Suppose, if you have Exchange Online Plan 1 license, you need to assign Exchange Online Plan archiving license to place the litigation hold on a mailbox.   

 

Enable Litigation Hold in Office 365: 

Admins can enable litigation hold on specific mailboxes using the Exchange admin center. To set up a litigation hold for the user’s mailboxes, follow the steps below: 

  1. Open Exchange admin center.  
  2. Navigate to Recipients → Mailboxes in the left pane.  
  3. Now select the user for whom you want to place a litigation hold. 
  4. After selecting the user, click on the Others tab.  
  5. Lastly, click the Manage the litigation hold to enable it.   

Note: Likewise, you can also specify the hold duration and add a note informing the user about the hold. 

Place Litigation Hold in Exchange Admin Center

Following are the impacts of placing a user mailbox on litigation hold: 

  • When you enable litigation hold, the Recoverable Items folder storage quota gets increased from 30 GB to 100 GB by default. 
  • The user’s archive mailbox items will be retained.  
  • The Recoverable Items subfolder holds the permanently deleted items by the user. 
  • Mailbox items purged from the Recoverable Items folder will be retained.  

Setting up an Exchange litigation hold is easy, but it’s impossible to place a litigation hold for all users or bulk users using the Exchange admin center. Also, it is difficult to gather all the details about users with and without litigation hold.

So, we have to go with the task automation in PowerShell. Let’s take a close look at how to enable litigation hold using PowerShell. 

 

Manage Litigation Hold Using PowerShell: 

It’s now easier than ever to place mailboxes on litigation hold with PowerShell! But, before proceeding, make sure you connect to Exchange Online PowerShell. 

Here are different use cases for placing mailboxes on hold. 

 

Check Whether a User Mailbox has Litigation Hold 

To verify the litigation hold status for a specific user mailbox, use the cmdlet given below. 

Get-Mailbox [email protected] | FL LitigationHold*

get litigation hold of a user mailbox using powershell

 

Extracting List of Users with Litigation Hold Enabled and Without

To check the litigation hold status of all the user mailboxes, use the following cmdlet. Also, you can export the mailbox hold report for a detailed analysis of user mailboxes with litigation hold and without. 

Get-Mailbox -ResultSize Unlimited | FL LitigationHold*

get litigation hold status of all users

 

Enable Litigation Hold for a Specific User

To enable litigation hold for specific Office 365 users, use the Set-Mailbox cmdlet with the LitigationHoldEnabled parameter. 

Set-Mailbox -Identity [email protected] -LitigationHoldEnabled $True

Note: The above cmdlet places a mailbox on litigation holds for an infinite period. 

 

Enable Litigation Hold for All Users

To enable the litigation hold for all the users regardless of their litigation hold status, set it up using the cmdlet given below. 

Get-Mailbox -ResultSize Unlimited -Filter "RecipientTypeDetails -eq 'UserMailbox'" | Set-Mailbox -LitigationHoldEnabled $true -LitigationHoldDuration 456

To place all the mailboxes on litigation hold for an infinite time, you can remove the LitigationHoldDuration parameter from the above cmdlet. 

 

Place Litigation Hold for Bulk Users (Import CSV) 

To set up litigation hold for only selected users, you can import the User Principal Name of the users in a CSV file, and execute the below cmdlet.  

Required Fields in CSV file: 

Create a CSV file with the User Principal Name of the Office 365 users.import csv file

Connect-ExchangeOnline 
$User = Import-Csv C:\setlitigationhold.csv 
foreach($user in $user){ 
Write-Progress -Activity "Placing litigation hold to -$user..." 
Set-Mailbox -Identity $User.User -LitigationHoldEnabled $True 
If($?) 
{ 
Write-Host Placed Litigation Hold Successfully to $User.user -ForegroundColor Green 
} 
Else 
{ 
Write-Host Error occurred while placing litigation hold to $User.user -ForegroundColor Red 
} 
}

 

Assign Litigation Hold to Users Who Have Not Enabled Before

Previously, admins should find out the users without litigation hold manually and place the hold for the required users. Now instead of the manual process, admins can achieve it using the below cmdlet. 

Get-Mailbox | Where {$_.LitigationHoldEnabled -match "False"} | ForEach-Object { 
$Identity = $_.alias; Set-Mailbox -Identity $Identity -LitigationHoldEnabled $True} 

This cmdlet finds and enables the litigation hold for the mailboxes that haven’t been assigned before. 

 

Enable Litigation Hold for a Specific Group or Department

Placing all mailboxes on hold may sometimes expose you to ransomware attacks, storage issues, etc., so it’s best to enable litigation hold for the required Office 365 groups or specific departments in the organization. Run the below cmdlet to set a particular department of Office 365 users on hold. 

Get-Recipient -RecipientTypeDetails UserMailbox -ResultSize unlimited -Filter '(Department -eq "Legal")' | Set-Mailbox -LitigationHoldEnabled $True

 

Set up Office 365 Litigation Hold Duration

You can specify the litigation hold duration for the user mailbox by configuring the LitigationHoldDuration parameter in the Set-Mailbox cmdlet. 

Set-Mailbox [email protected] -LitigationHoldEnabled $true -LitigationHoldDuration 1095 

Note: Mention the hold duration in terms of days. (i.e., if you want to set litigation hold for three years, set approximately 1095 days) 

 

Disable Litigation Hold Using PowerShell

Litigation hold won’t let you delete emails or mailbox items. Thereby your storage capacity exceeds the mailbox quota over time. So to disable litigation hold from a specific recipient, you can set the LitigationHoldEnabled parameter to False. This will automatically turn off the litigation hold for the given mailboxes.    

Set-Mailbox -Identity [email protected] -LitigationHoldEnabled $False 

To remove litigation hold from all mailboxes in Exchange Online, then you can set the LitigationHoldEnabled parameter to False 

Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | Set-Mailbox -LitigationHoldEnabled $False 

 

That’s it! There you go. I hope we’ve shown a clear idea of how to manage the litigation hold in Office 365. If you need further assistance with litigation hold, feel free to reach us in the comment section. We would be glad to assist you! 

Enable Litigation Hold in Office 365 Using PowerShell

by Pavithra time to read: 5 min
0