Quantcast
Channel: o365info
Viewing all articles
Browse latest Browse all 374

Manage Litigation Hold by using PowerShell | Office 365

$
0
0

Litigation Hold is an Exchange server future that enable us to “freeze” all the mail items that were deleted by user and keep this mail items 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 customers that purchased Exchange Online E3 license or Exchange Online Plan 2.

The current article describes the way that we apply Litigation Hold on Exchange Online mailboxes. In case that you need information regarding the part that relate to “how to recover mail items” from a mailbox with Litigation Hold, you can read the article – Using Exchange In-place eDiscovery & Hold for recovering deleted mail items | 6#7

PowerShell | Help & additional information

In case that you are a novice in the PowerShell environment, you can use the following link to get more information about the “first steps” such as: downloading the required PowerShell
software components, how to use the PowerShell console, running a PowerShell script, etc.

Read more
Link Table
PowerShell Naming Conventions & general information

If you want to get more information about the Naming Conventions that we use for this article and get some general tips about: how to work with the PowerShell, read the article: Help and additional information – o365info.com PowerShell articles

Create remote PowerShell session

Before we can use the required PowerShell commands, we need to download and install the Office 365 cmdlets + create remote PowerShell session to Office 365 or Exchange Online. If you need more information about how to create a remote PowerShell session read the following articles: Part 2: Connect to Office 365 by using Remote PowerShell and Part 3: Connect to Exchange Online by using Remote PowerShell

How to use a PowerShell script

Most of the PowerShell articles include a PowerShell script that simplifies the use of the PowerShell commands. If you want to get more information about: How to use a PowerShell script, read the article: Connect to Office 365 and Exchange Online using a script

PowerShell command and Script languish in more details

If you are new to the PowerShell world, you can read more information about PowerShell in Office 365 environment in the article: The Power of PowerShell

1. Assign Litigation Hold

1.1 – Assign Litigation Hold to specific recipient (Exchange Online mailbox)

PowerShell command Syntax

Set-Mailbox <Identity> -LitigationHoldEnabled $True

PowerShell command Example

Set-Mailbox John -LitigationHoldEnabled $True

1.2 – Assign Litigation Hold to a specific recipient (Exchange Online mailbox) + define time range (7 years).

PowerShell command Syntax

Set-Mailbox <Identity> -LitigationHoldEnabled $True -LitigationHoldDuration <time range >

PowerShell command Example

Set-Mailbox John -LitigationHoldEnabled $True -LitigationHoldDuration 2555

1.3 – Assign Litigation Hold to all of the Exchange Online recipients (Bulk mode)

PowerShell command Syntax

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

1.4 – Assign litigation Hold to Exchange Online recipients (Bulk mode) based on a criterion | Department

PowerShell command Syntax

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

PowerShell command Example

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

1.5 – Assign litigation Hold to Exchange Online recipients that don’t have Litigation Hold

PowerShell command Syntax

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

2. Display information about Litigation Hold

2.1 – Display information about specific recipient which his mailbox has Litigation Hold

PowerShell command Syntax

Get-Mailbox <Identity> | FL LitigationHold*

PowerShell command Example

Get-Mailbox John | FL LitigationHold*

2.2 – Display information about all of the mailboxes which have Litigation Hold

PowerShell command Syntax

Get-Mailbox -ResultSize Unlimited | FL LitigationHold*

2.3 – Display information about User mailboxes which has Litigation Hold using the filter operator

PowerShell command Syntax

Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | FL Name,LitigationHold*

2.4 – Display information about User mailboxes which has Litigation Hold using the Where operator

PowerShell command Syntax

Get-Mailbox | Where {$_.LitigationHoldEnabled -match "True"} | FL Name,LitigationHold*

2.5 – Display information about User mailboxes which doesn’t have Litigation Hold

PowerShell command Syntax

Get-Mailbox | Where {$_.LitigationHoldEnabled -match "False"} | FL Name,LitigationHold*

2.6 – Display information about mailboxes which have Litigation Hold | information about the recoverable items folder.

PowerShell command Syntax

Get-Mailbox -ResultSize Unlimited -Filter {LitigationHoldEnabled -eq $true} | Get-MailboxFolderStatistics –FolderScope RecoverableItems | Format-Table Identity,FolderAndSubfolderSize -Auto

3. Remove Litigation Hold

3.1 – Remove Litigation Hold to specific recipient (Exchange Online mailbox)

PowerShell command Syntax

Set-Mailbox <Identity> -LitigationHoldEnabled $False

PowerShell command Example

Set-Mailbox John -LitigationHoldEnabled $False

3.2 -Remove Litigation Hold to all of the Exchange Online recipients (Bulk mode)

PowerShell command Syntax

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

4. Download the Litigation Hold PowerShell menu script

For your convenience, I have “Wrapped” all the PowerShell commands that were reviewed in a PowerShell Script named: Retention-Policy.ps1
You are welcome to download the script and use it.

download-button-02.png

PowerShell command syntax – Office 365 | Article series index

Now it’s Your Turn!
We really want to know what you think about the article

The post Manage Litigation Hold by using PowerShell | Office 365 appeared first on o365info.com.


Viewing all articles
Browse latest Browse all 374

Trending Articles