Hello,
The value reference %adm-ManagerEmail% is not available for group objects. The reason for this is the difference in attribute names. User objects can have a manager and the value is stored in the attribute named Manager. Group objects can have an owner and the value is stored in the attribute named Managed By. As such, attempting to use %adm-ManagerEmail% to retrieve the e-mail of the group owner will resolve in an empty string.
Currently, we don’t have virtual properties for object owners, but we have the feature in our roadmap.
The task you want to accomplish can be done using a PowerShell script. In your Scheduled Task, you will need to replace the Send email notification action with Run a Program or PowerShell Script and use the script below.
In the script:
- $subject – Specifies the email notification subject.
- $message – Specifies the email notification text.
$subject = "Notification for the manager of %name% group" # TODO: modify me
$message = "Message Text" # TODO: modify me
# Bind to the group owner
try
{
$owner = $Context.BindToObjectByDN("%managedBy%")
}
catch
{
$Context.LogMessage("No owner is specified for the group %name%", "Warning")
return
}
# Get owner email address
try
{
$ownerMail = $owner.Get("mail")
}
catch
{
$Context.LogMessage("No email address is specified for the owner of group %name%", "Warning")
return
}
# Send mail
$Context.SendMail($ownerMail, $subject, $message, $NULL)