Send Initial Password to Newly Created Users via SMS
Using Adaxes you can automatically send email and SMS notifications on practically any event in Active Directory. In this tutorial you will learn how to configure Adaxes to automatically send an SMS with the username and initial password to each new user created in Active Directory.
To configure SMS settings, right-click your Adaxes service in Adaxes Administration Console, click Properties in the context menu, and activate the SMS Settings tab.
To automatically send SMS messages to newly created users, you need to define a Business Rule triggered by creation of new user accounts in Active Directory.
- Select User in the Object Type list.
- Select After in the Operation section.
- Select Creating a User in the Operation section.
- Click Next.
- Click the Add Action link.
- In the dialog that opens, select the Send SMS action.
- In the To field, enter a value reference to the property that contains mobile phone numbers of AD users. If mobile numbers are stored in the Mobile Phone property, specify %mobile% in the edit box.
-
In the SMS text field, enter the SMS message text. For example:
Username: %username% Password: %unicodePwd%
To include information about the newly created user in the SMS text, you can use value references (e.g. %name%, %department%, %title%). Before sending an SMS message, Adaxes will replace these value references with the property values of this user. To include the user password in the text, use %unicodePwd%.
-
Select the action/condition set and click the
Add Condition icon.
- In the dialog that opens, select the If <property><relation><value> condition type.
- In the Condition Parameters section, specify Mobile Phone is not empty.
- Click OK.
- Select the built-in Property Pattern called User Pattern in the Console Tree.
- Add a Property Pattern item for the Mobile Phone property.
- Enable The property is required option for the item.
- Click OK and then Save changes.
-
All Objects - select if you want this Business Rule to be executed when a
user is created in any AD domain managed by Adaxes.
-
Specific Domain - select if you want this Business Rule to be executed when
a user is created in the AD domain you specify.
-
OU or Container - select if you want this Business Rule to be executed only
when a new user is created under the selected Organizational Unit.
Select the item you need and click Add. When finished, click OK.
Now, every time a new user is created in Active Directory (no matter in which way - using Administration Console, Web Interface, during data import, via PowerShell scripts, etc.), Adaxes will automatically send an SMS message with username and password to this user.
Send SMS using PowerShell Scripts
In advanced cases you may prefer to send SMS messages using a PowerShell script. To do this, you Business Rule must execute the Run a program or PowerShell script action.
Example:
$mobilePhone = "%mobile%"
if ([System.String]::IsNullOrEmpty($mobilePhone))
{
$Context.LogMessage("Mobile phone is not specified.", "Warning")
return
}
$smsText = "Username: %username% Password: %unicodePwd%"
$Context.SendSms($mobilePhone, $smsText)
