
you can use an Azure Runbook:
https://www.howdoiuseacomputer.com/index.php/2021/09/13/azure-runbook-enable-exchange-online-litigation-hold/
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
we want to place members (existing and new) from specific department always on litigation hold permanently - is there way to achieve it?
you can use an Azure Runbook:
https://www.howdoiuseacomputer.com/index.php/2021/09/13/azure-runbook-enable-exchange-online-litigation-hold/
Yea, you could craft this to do that:
https://learn.microsoft.com/en-us/microsoft-365/compliance/use-a-script-to-add-users-to-a-hold-in-ediscovery?view=o365-worldwide
or just create a group - put that group on a hold and ensure the new users are always added to it:
For Exchange online, there doesn't exist such function. Here may be a work around for you:
You could follow this blog to create a Task Scheduler to run script below daily, it will check and enable LitigationHold for mailbox.
#Conenct to Exchange online, remember to change the Accout and Password
$Account = "******@domain.onmicrosoft.com"
$PassWord = ConvertTo-SecureString -String "Password" -AsPlainText -Force
$UserCredential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $Account, $PassWord
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -DisableNameChecking
#Find mailbox which belong to Department 321, if LitigationHold isnot enabled, enable this function for that mailbox
$users = Get-User -Filter "Department -eq '321' -and RecipientType -eq 'UserMailbox'"
ForEach($user in $users){
if (!(Get-Mailbox $user.name).LitigationHoldEnabled) {
Set-Mailbox $user.name -LitigationHoldEnabled $true -LitigationHoldDuration unlimited
}
}
#exit
Remove-PSSession $Session
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.