0 votes

Hello, i have created a custom attribute named user entry date. When a new user is created they need to enter the entry date with the create user command.

The entry date is saved in the adm-CustomAttributeText5.

2024-06-07 11_41_00-Remote Desktop Manager \[adm001.rubnergroup.local\].png2024-06-07 11_40_23-Remote Desktop Manager \[adm001.rubnergroup.local\].png

I have a buisness rule that checks if a user is added to a specific group. If the user is added successfully an email is sent automatically. In this email I would like to add the %adm-customattributetext5% of the user added to this specifc group. How can I achieve this?

2024-06-07 11_36_25-Remote Desktop Manager \[adm001.rubnergroup.local\].png

It seems like it can not read the %adm-customattributetext5% of a user on a group buisness rule because it does not write any value in the sent email.

Thank you, Fabian

by (380 points)
0

Hello Fabian,

The behavior is expected as value references only resolve for the target object which is the group here. The only option to achieve the desired, is using a script. For us to assist you with it, please, specify what should be done in case adm-CustomAttributeText5 is empty for the member. Any additional details will be much appreciated.

0

As the adm-customattributetext5 needs to have a value for new users it should never be empty.

Although it can rarely happen that existing users get added to this group and they do not have a value. If possible i would set the adm-CustomAttributeText5 to this text "alredy existing user".

0

Hello Fabian,

Do you mean that if empty, the script should update the property value for the member and add the same value to the email notification?

0

Hello,

no in this case the property value can remain empty.

0

Hello Fabian,

If possible i would set the adm-CustomAttributeText5 to this text "alredy existing user".

Then what do you mean by this?

0

I'm sorry I ment to insert in the email instead of the attribute value the text "already existing user". If it's too complicated it can remain empty.

1 Answer

0 votes
by (288k points)
selected by
Best answer

Hello Fabian,

Thank you for clarifying. You can use the below script. In the script:

  • $to – Specifies email addresses of the notification recipients.
  • $subject – Specifies the email notification subject.
  • $emailBodyTemplate – Specifies the email notofication template. In the template, the {0} placeholder will be replaced with the value of the property specified in the $entryDatePropertyName variable.
  • $entryDatePropertyName – Specifies the schema name of the member property whose value will be included into the email notification.
$to = "recipient@company.com, recipient2@company.com" # TODO: modify me
$subject = "My Subject" # TODO: modify me
$emailBodyTemplate = @"
Hello,

The user %adm-MemberFullName% has been added to the %name% group.

Entry date: {0}
"@ # TODO: modify me

$entryDatePropertyName = "adm-CustomAttributeText5" # TODO: modify me

# Get member property value
$member = $Context.BindToObjectByDN("%member%")

try
{
    $memberPropertyValue = $member.Get($entryDatePropertyName)
}
catch
{
    $memberPropertyValue = "already existing user"
}

# Send mail
$emailBody = [System.String]::Format($emailBodyTemplate, @($memberPropertyValue))
$Context.SendMail($to, $subject, $emailBody, $NULL)

Related questions

0 votes
1 answer

Hello everyone, I've received a task to send a report of pending and denied approval requests of a specific task to an email of one of our managers. Since ... $report = $reportHeader + $reportFooter # Send Mail $Context.SendMail($to, $subject, $NULL, $report)

asked Apr 7, 2020 by rshergh (110 points)
0 votes
0 answers

We currently are experiencing an issue with 365 where a user placed in eDiscovery and hold is left in an "active mailbox" state. One of the problems this causes is the ... is removed. Do you have any suggestions on how we could work around this problem?

asked Aug 5, 2015 by auser42 (340 points)
0 votes
1 answer

We're utilizing the custom adaxes attributes for a few parts in our employee onboarding procedure. Among them is a step where we specify what buildings a user will need ... get all the values of "adm-CustomAttributeTextMultiValue1" to be sent out in an email?

asked Aug 9, 2021 by KruzGaffaney (50 points)
0 votes
1 answer

We have a 3rd party vendor that we are able to add users based on AD security groups. What I need to do is set a parameter for the number of available licenses and whenever ... the group is 495 I would like an email to trigger telling me to add more licenses.

asked Oct 12, 2022 by A_Pastor (70 points)
0 votes
1 answer

Hello, I am attempting to configure a business rule that adjusts an adaxes custom property of a user, upon that user being added/removed from a group. I cannot seem to ... (like username, office, description, email, etc.) but not so much on custom attributes.

asked Jul 14, 2023 by NKB#2772 (70 points)
3,541 questions
3,232 answers
8,225 comments
547,802 users