Script Repository

Send multi-value property values via email

February 24, 2021

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 = "" # 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 )
No results found.
Leave a comment

Related Scripts