0 votes

Hi!

Is it possible to set the initiator &/ the created user (when doing a user creation) as the sending email adress for a outgoing email from Adaxess?

The use case is that we want to submit tickets to our helpdesk (Jira Servicedesk) and both have them come from the right person and when its a new user, get auto creation of the user account from AdAxess by means of the email thats beeing sent.

Currently its sent from the fixed from address thats setup in settings for the server.

/Kaj

by (650 points)
0

Did search a bit and found Automate an email based on anniversary/birthdate.

Modified it a bit, would this work as a run a powershell script?
The question is if the created users email adress is in the %mail% variable?

$to = "Jira" # TODO: modify me
$smtpServer = "mail.domain.com" # TODO: modify me
$subject = "New user creation" # TODO: modify me
$from = "%mail%" # TODO: modify me
$htmlMessage = "<b>Edit this user to show real name</b><br>And then close the case" # TODO: modify me

if ($from -eq $NULL)
{
    $Context.LogMessage("The email address for the %mail% is not specified", "Warning")
    return
}

# Send mail
Send-MailMessage -To $to -From $from -SmtpServer $smtpServer -Body $htmlMessage -BodyAsHtml -Subject $subject

1 Answer

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

Hello Kaj,

The condition if ($from -eq $NULL) will not work because it is checking a string for being empty. You need to use the following code instead:

if ([System.String]::IsNullOrEmpty($from))

Also, as we can see, the log message that will be added to the execution log contains the %mail% value reference. It will always resolve into an empty value as the message is added only when the target user has no email address. Most probably, you wanted to add the user Full Name to the message. In this case, you need to use value reference %fullname%.

The rest of the script looks correct and should work just fine.

Related questions

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 (960 points)
0 votes
1 answer

Hello, i have a custom command which sets the oof-message for the selected user. in this custom command i have a parameter "param-vertretung" (ad-object picker). Now i want to ... and email of the stand-in in the oof-message. Can you help me with that? Thanks

asked Nov 13, 2020 by lohnag (140 points)
0 votes
1 answer

We have a process that when a new user is created they are emailed their username and apssword. If the user is in an Admin Group they are then sent an email with some PDFs ... you can send emails, but am unable to see where it could attach files to the email?

asked Sep 3, 2020 by dknapp (100 points)
0 votes
1 answer

On scheduled tasks, business rules, and custom commands, inside an if statement, you have the option for it to be "AND" or "OR" in the condition. Can there be a ... a bunch of computer accounts to be deleted. We think this would be a good safety measure.

asked Mar 22, 2021 by mark.it.admin (2.3k points)
0 votes
1 answer

We recently had an issue that will require us to change the password of the service account we use for Adaxes. I saw some documentation on changing the service account ... do a complete uninstall/reinstall to change the password if I do not need to.

asked Jul 6, 2020 by knowtheledge (130 points)
3,164 questions
2,868 answers
7,358 comments
505,651 users