0 votes

I have a Business Rule in place that after a new user is created, will create an Exchange mailbox for the user, set the Retention Policy for the user, then send them a welcome email. The welcome email action keeps failing with the following error:

Resolving value references in the notification recipient address '%mail%' resulted in an empty string. There are no recipients specified.

However, when I look at the user after they are created and the action fails, their %mail% attribute is populated with the correct email address for the user. Is this maybe just a timing issue or something?

by (320 points)

1 Answer

0 votes
by (216k points)

Hello,

The thing is that when an AD operation triggers Business Rules, Adaxes collects all the Business Rules that will be triggered by a particular operation and resolves all the value references used in them. Only after that, Adaxes starts executing actions, and the value references are not recalculated. Since it is the Business Rule that creates a mailbox for the new user, the Email property is empty before executing the Rule, when value references are resolved.

To workaround this, you can use on of the two available options:

  1. In your Business Rule, you can send an e-mail using a PowerShell script. In the script, you can use the IADs::Get method to get the current value of the Email property. If the script follows after creation of the mailbox, the method will return the address set for the user.

    For information on how to use the method, see subsection Using $Context.TargetObject in the following SDK article: http://www.adaxes.com/sdk/?ServerSideScripting.html.

    For information on how to send e-mails with the help of a script, see section Sending Emails and SMS.

    To run a PowerShell script as a part of a Business Rule, you can use the Run a program or PowerShell script action.

  2. Alternatively, you can create a Business Rule triggered After Creating an Exchange mailbox for the User and send the e-mail using that Rule. In such a case, the value references for the Business Rule will be resolved after creating a mailbox.

0

Sorry to dig up an old post.

While this method works most of the time sometimes it doesnt(especially when the mailbox is created at a remote site). I can add more time on the delay but the longer delay we add the longer time the IT team has to sit on the creating user screen after clicking create. After hitting create we have to wait 2+ min until the steps are done on teh backend. I have the start-sleep script set at 120 seconds.

Is there a way to have the welcome email set to send even later and not having the IT team sitting at the creating screen?

0

Hello,

Yes, it is possible. You need to use a Business Rule triggering After Creating an exchange mailbox for a User. To create the rule:

  1. Launch Adaxes Administration Console.
  2. Right-click your Adaxes service node, navigate to New and click Business Rule.
  3. On step 2 of the Create Business Rule wizard, select User Object type.
  4. Select After Creating an exchange mailbox for a User and click Next.
  5. Click Add Action.
  6. Select Send e-mail notification.
  7. In the To field, enter %mail%.
  8. Specify the notification subject and message text and click OK.
  9. Click Next and finish creating the Business Rule.
0

Back to this again. This is still not working correctly. Is there a way to get the "welcome" email I have setup to send 5 min or so later without having the IT person sitting at the creating mailbox screen?

I have done the start-sleep setting but it seems that is ignored and the email is trying to be sent right away all while the tech is sitting at the creating screen?

The issue we have is still, when the user is on a remote exchange server the welcome email never makes it to the mailbox because the mailbox had not been created yet on the remote server. For the local server the mailbox gets created pretty fast.

Is there something else I can do?

0

Hello,

Could you post here or send us (support[at]adaxes.com) a screenshot of the Business Rule you have?

0

Hello

Exchange lives it's own life and I had to insert a "Start-Sleep -Seconds 60" before sending the welcome mail - to ensure, that the new user's mailbox (and mail address) was created and ready on our Exchange server.

I create the personal mailbox using powershell running as a Custom Command, after creating the user.

As an alternative to the sleep command, you could use a loop routine (with a safety exit switch), that probes if the mailbox is ready. This may reduce the time you must wait before the job completes.

Hope that helps.

Related questions

0 votes
0 answers

Good Morning, Interesting issue, newly created users created in Adaxes don't show AD group membership when viewing in Adaxes but the groups show normally in AD. Users ... idea why users crearted in Adaxes cannot see the groups while other users appear fine?

asked Aug 2, 2023 by curtisa (290 points)
0 votes
1 answer

We have been using Business Rules for newly created/changed active directory objects successfully for sometime now. In our current environment, most of our user objects are being ... Or is this better handled by a scheduled task to process newly created users?

asked Mar 25, 2015 by cmcgrath (70 points)
+1 vote
1 answer

We would like to build the following construct, but we do not know how to make this feasible: We would like to store several approvers at one approval request. These approvers ... there a way to do this? Or would this be possible to build a powershell script?

asked Apr 28, 2022 by robin.christmann (160 points)
0 votes
1 answer

I am trying to configure Adaxes to talk to my O365 Tenant. Following the guide here - https://www.adaxes.com/tutorials_Active ... ice365.htm - I am getting stuck on the ... the same rights that I have set on the service account) Is anybody able to help?

asked Jun 13, 2019 by lucaswhizz (50 points)
0 votes
1 answer

I'm trying to modify mailbox settings to add additional email addresses to a user after creation. This is a hybrid on-prem and Exchange Online with E5 licenses. Everything works up ... to a different OU during the process so I know the user exists. Any ideas?

asked Mar 6, 2023 by Michael Long (70 points)
3,588 questions
3,277 answers
8,303 comments
548,082 users