The script checks whether the Automatically update e-mail addresses based on e-mail address policy option is enabled for an Exchange recipient. To add the check to your business rule, custom command or scheduled task using the If PowerShell script returns true condition.
Return Values:
- True: the option is enabled for the recipient;
- False: either the option is not enabled for the recipient or the AD object is not a reciepent in Exchange.
PowerShell
$Context.ConditionIsMet = $False
try
{
$mailboxParams = $Context.TargetObject.GetMailParameters()
}
catch
{
return
}
$Context.ConditionIsMet = $mailboxParams.EmailAddressPolicyEnabled -eq $True