We use cookies to improve your experience.
By your continued use of this site you accept such use.
For more details please see our privacy policy and cookies policy.

Script repository

Check whether a certain mailbox feature is enabled

August 02, 2023 Views: 2959

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

Edit Remove
PowerShell
try
{
    $mailboxParams = $Context.TargetObject.GetMailParameters()
}
catch
{
    return
}
$litigationHold = $mailboxParams.MailboxFeatures.GetItemByType("ADM_EXCHANGE_MAILBOXFEATURETYPE_LITIGATIONHOLD")
    
$Context.ConditionIsMet = $litigationHold.Enabled

Archive feature

Edit Remove
PowerShell
try
{
    $mailboxParams = $Context.TargetObject.GetMailParameters()
}
catch
{
    return
}
$archive = $mailboxParams.MailboxFeatures.GetItemByType("ADM_EXCHANGE_MAILBOXFEATURETYPE_ARCHIVE")
    
$Context.ConditionIsMet = $archive.Enabled
Comments 0
Leave a comment
Loading...

Got questions?

Support Questions & Answers