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 (2.9k points)
edited by

1 Answer

+1 vote
by (970 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 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 by mark.it.admin (3.9k points)
0 votes
1 answer

Is this possible? Example: User A executes a task in Adaxes. That task triggers a mail to another user. That mail needs to have User A as a reply adress.

asked Jun 21, 2019 by kjesoo (7k points)
0 votes
1 answer

Hi Can you lead us to what we are doing wrong with this report? `$CID ="{ed8afa99-e34d-4531-b69a-0bd0785f4d3a}" $folders = gci -force '\server\Kunden'-ErrorAction ... Value generation = Template, empty. ColumnID is double checked an is the right one. Thanks

asked Mar 5 by maca (850 points)
0 votes
1 answer

Hi! I need a report of user accounts with empty attributes. Is there a possibility to make such report? Thanks in advance.

asked Sep 11, 2009 by philip (250 points)
0 votes
1 answer

I'm building my first rule to license users in Office365. When the rule runs it fails to find the Usage Location which is based on the Country (default settings). I ... runs before the "assign 365 license" rule. Why am I not getting Usage Location populated?

asked Jul 20 by ComputerHabit (3k points)
2,247 questions
2,007 answers
5,495 comments
20,751 users