The scripts are used to check whether a certain mailbox feature is enabled. If the featue is disabled, the scripts return false. To execute the scripts, use the If PowerShell script returns true condition.
Litigation Hold feature
PowerShell
try
{
$mailboxParams = $Context.TargetObject.GetMailParameters()
}
catch
{
return
}
$litigationHold = $mailboxParams.MailboxFeatures.GetItemByType("ADM_EXCHANGE_MAILBOXFEATURETYPE_LITIGATIONHOLD")
$Context.ConditionIsMet = $litigationHold.Enabled
Archive feature
PowerShell
try
{
$mailboxParams = $Context.TargetObject.GetMailParameters()
}
catch
{
return
}
$archive = $mailboxParams.MailboxFeatures.GetItemByType("ADM_EXCHANGE_MAILBOXFEATURETYPE_ARCHIVE")
$Context.ConditionIsMet = $archive.Enabled