Script repository
The scripts are used to check whether a certain mailbox feature is enabled. If the feature is disabled, the scripts return false. To execute the scripts, use the If PowerShell script returns true condition in a business rule, custom command or scheduled task.
Litigation Hold
try
{
$mailboxParams = $Context.TargetObject.GetMailParameters()
}
catch
{
return
}
$litigationHold = $mailboxParams.MailboxFeatures.GetItemByType("ADM_EXCHANGE_MAILBOXFEATURETYPE_LITIGATIONHOLD")
$Context.ConditionIsMet = $litigationHold.EnabledArchiving
try
{
$mailboxParams = $Context.TargetObject.GetMailParameters()
}
catch
{
return
}
$archive = $mailboxParams.MailboxFeatures.GetItemByType("ADM_EXCHANGE_MAILBOXFEATURETYPE_ARCHIVE")
$Context.ConditionIsMet = $archive.Enabled
Comments 2
You must be signed in to comment.
Grant
Does this check the Litigation Hold status in Exchange Online if the user is a remote mailbox (hybrid environment)? If not can you share how I would change this for an Exchange Online mailbox.
Support
Hello Grant,
The script works just fine for remote mailboxes.