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

Send multi-value property values via email

February 24, 2021 Views: 848

The script sends an email notification containing all values of a multi-value property. To run the script, you can use a custom command, a business rule or a scheduled task configured for the corresponding object type (e.g. user).


  • $propertyName - Specifies the LDAP name of the property whose values will be included into the email notification.
  • $to - Specifies the recipient's email address.
  • $subject - Specifies the email notification subject.
  • $messageTemplate - Specifies a template of the email notification. In the template, the {0} placeholder will be replaced with values of the property spacified in the $propertyName variable.
Edit Remove
$propertyName = "adm-CustomAttributeTextMultiValue1" # TODO: modify me

# E-mail settings
$to = "recipeint@domain.com" # TODO: modify me
$subject = "Values of '$propertyName' property" # TODO: modify me
$messageTemplate = "Values: {0}" # TODO: modify me

# Get property values
    $values = $Context.TargetObject.GetEx($propertyName)
    $values = $NULL

if ($values -eq $NULL)
    $values = "Not specified"
    $values = [System.String]::Join(";", $values)

# Build message
$message = [System.String]::Format($messageTemplate, $values)

# Send mail
$Context.SendMail($to, $subject, $message, $NULL)

Comments 0
Leave a comment

Got questions?

Support Questions & Answers