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 (3k 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 (184k 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

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 by dknapp (690 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

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 by knowtheledge (880 points)
0 votes
1 answer

We are evaluating the product and would like to let users of AD to change password in self service page. We would like to set a 90 days change password policy, ... self service page? Is it achievable (with customization and batch program)? Thanks in advance.

asked Apr 27 by eric (250 points)
0 votes
1 answer

Is there a way to change the default site that shows up to adaxes instead of the IIS 7 default splash page?

asked Aug 5, 2019 by john.morrow (1.2k points)
2,288 questions
2,043 answers
5,580 comments
55,007 users