Hello,
Thank you for clarifying. Here is the script you can use in a custom command. The script should be executed in the Run a program or PowerShell script action. For details on creating a custom command, see https://www.adaxes.com/help/CreateCustomCommand.
# Get user mailbox parameters
try
{
$mailboxParams = $Context.TargetObject.GetMailParameters()
}
catch
{
$Context.LogMessage("User %fullname% has no mailbox.", "Information")
return
}
# Get user litigation hold settings
$litigationHold = $mailboxParams.MailboxFeatures.GetItemByType("ADM_EXCHANGE_MAILBOXFEATURETYPE_LITIGATIONHOLD")
if ($litigationHold.Enabled -eq $False)
{
$Context.LogMessage("User %fullname% is not on hold.", "Information")
return
}
# Output user litigation hold settings
$Context.LogMessage("Litigation hold start date:" + $litigationHold.StartDate, "Information")
$Context.LogMessage("Litigation hold owner:" + $litigationHold.Owner, "Information")