0 votes

I have a custom command that prompts for a "reporter" for our ticketing system for enabling VPN accounts. Sometimes a technician will enable an account on behalf of another user who is owner of the system affected. The parameter "Reporter" is an AD object picker. I then have an Action to create a Jira ticket using Powershell with that parameter as reporter. It also sends e-mail notification (additional action) to the vendor, the reporter, and the IT team. The To: box contains %mail% for the vendor (action is performed on an account),; %param-Reporter%; IT@domain.com. The %param-Reporter% thows an error because it's not an email address. How do I extract the email address of that object chosen as a parameter? Thank you.

by (70 points)

1 Answer

0 votes
by (213k points)

Hello,

This can only be done by sending the email notification using a PowerShell script. To send email notifications in PowerShell scripts, use the $Context.SendMail method. To get the email address of the user specified in the Custom Command parameter, use the below code, where param-MyParameter is the name of the parameter with the param- prefix:

$user = $Context.BindToObjectByDN("%param-MyParameter%")

try
{
    $userEmail = $user.Get("mail")    
}
catch
{
    $Context.LogMessage("The user specified in parameter 'MyParameter' has no email address. ", "Information")    
} 

Should you have issues writing the script, we will help you.

Related questions

0 votes
1 answer

Hi, I am Create a Custom Command. The Parameters UI Control is AD object picker. The Action is add the Parameters in Extension Attribute 1 But it will add the AD DN. If I want to add LogonName, what parameters should I enter?

asked Aug 2, 2021 by will.chc.join (50 points)
0 votes
1 answer

Hello The search function in the AD object picker seems to be limited to the attribute "Name". I have some AD groups where the name is not very meaningful for our ... these cases. Is there any way to include the "Description" attribute in the search? Pudong

asked Sep 26, 2021 by pudong (210 points)
0 votes
1 answer

Hi I've added values to two attributes of an Oraganization Unit: adm-CustomAttributeText1 adm-CustomAttributeText2 I'm trying to extract these properties with a powershell ... But this does not provide the value set in adm-CustomAttributeText1. Any ideas?

asked Jan 28, 2013 by kjesoo (960 points)
0 votes
1 answer

I'm not able to retrieve the Description of a user using ADSI. I'm trying user.Get("description").ToString() on IADsUser I get the error, The 'description' property cannot be found in the cache. Is there a different method I need to use to get Description?

asked Feb 6, 2017 by sdavidson (730 points)
0 votes
1 answer

Is it possible to send an email from Adaxes when certain AD objects are modified outside of Adaxes? With Business Rules it looks pretty easy to do that inside of Adaxes ... something changes on the object and the change was not initiated by Adaxes. Thank you.

asked Jul 23, 2021 by mikek (80 points)
2,643 questions
2,377 answers
6,310 comments
987,514 users