0 votes

Hi, we want to send email notification to managers of empty distribution groups. So I created scheduled task targeted to group and in send action TO, I used '%adm-ManagerEmail%. But this action always end with error "Resolving value references in the notification recipient address '%adm-ManagerEmail%' resulted in an empty string."

Testing group has me as manager. My AD account has E-mail attribute filled.

What could be the problem?

Thanks

by (910 points)
edited by

1 Answer

+1 vote
by (3.6k points)

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)

Related questions

0 votes
1 answer

We have business rule attached to "adding member to a group" which tuns powershell script and it was working fine. But (probably after the update to newest 2023 version) script ... the error and that the %member% is clearly empty: How can I fix this please?

asked Feb 15, 2023 by KIT (910 points)
0 votes
0 answers

Here is an example: In Azure the manager shows populated: In Adaxes it shows a blank:

asked Dec 2, 2022 by adaxes_user2 (40 points)
+1 vote
1 answer

Good morning Support, I'm trying to connect to our AzureAD service as specified in the GetAzureAuthAccessToken(String) section ofCloudServices SDK - https://www.adaxes.com/sdk/ ... m working on a process to simply remove users from Cloud groups. Thank you!

asked Dec 3, 2021 by TheOtherBrian (70 points)
0 votes
1 answer

Hi, I need to run a schedule task only if a customattribute is not empty. Can I use ConditionIsMet?

asked Oct 7, 2021 by Simone.Vailati (430 points)
0 votes
1 answer

We are attempting to use the member property in a powershell script for all groups. We get this error message on certain groups that are used as "primary". If we set another ... just shows the single member in the group in which the group is not the primary.

asked Feb 19, 2020 by mark.it.admin (2.3k points)
3,326 questions
3,026 answers
7,727 comments
544,678 users