Translate

Friday, May 3, 2019

eDiscovery - Put mailboxes On Litigation Hold using PowerShell Script


O365 administrators can use GUI to put SharePoint sites, ODB, mailbox on litigation hold. Microsoft eDiscovery UI helps admins to create a Case and apply Hold to mailboxes. However, there are PowerShell scripts available to put mailboxes On Litigation Hold and you do not need to create Cases for it. 

Below is how we do that  -

1. Connect to Exchange Online

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session –DisableNameChecking

2. Check Litigation Status of the mailbox

Get-Mailbox -identity rajdeepc@onmicrosoft.com |fl Identity, LitigationHold*

3. Put the mailbox on hold

Set-Mailbox -identity rajdeepc@onmicrosoft.com -LitigationHoldEnabled $true

4. (Optional) Use the content search to get collection for your legal team

5. Release the mailbox if it is not needed to be On Litigation Hold

Set-Mailbox -identity rajdeepc@onmicrosoft.com -LitigationHoldEnabled $false

6. Disconnect the session (Must do to ensure the session is not occupied)

Remove-PSSession $Session



Wednesday, May 1, 2019

Enable SPO Site Collection App Catalog


By now everyone knows how to enable Site Collection App Catalog in SharePoint Online. It is simply to run the commands like below -

Connect-SPOService -Url {SharePointAdminSiteURL} -Credential rajdeep@domain.net
$site = Get-SPOSite {SiteCollectionURL}
Add-SPOSiteCollectionAppCatalog -Site $site

You may encounter an error like "Must have Manage Web Site permissions or be a tenant admin in order to add or remove sites from the site collection app catalog allow list". This is because if the person who's executing the command is not admin in the App Catalog site.

Add rajdeep@domain.net as admin in the site collection app catalog and run it again.