Send Initial Password to 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 send an SMS with the username and initial password when a new user account is created.

SMS Settings

Adaxes can deliver SMS messages through any SMS gateway service that supports SMTP and HTTP/S delivery. You need to have either an internal SMS gateway service or subscribe to an external provider that supports the Email to SMS or HTTP/S to SMS (REST API) feature.

  • In Adaxes Administration Console, right-click your Adaxes service and click Properties.

  • Activate the SMS Settings tab and check the Enable SMS checkbox.

  • Configure the settings and click OK.

To automatically perform actions when a certain event takes place, you need to use Business Rules. Adaxes provides built-in Business Rule After User Creation that is triggered after a new user is created. You can use the Business Rule to communicate usernames and passwords to users.

  1. Launch Adaxes Administration Console.

    Expand Adaxes service \ Configuration \ Business Rules \ Builtin and select After User Creation.

    For details on how to configure and activate the Business Rule, see Automate User Provisioning.

    Alternatively, you can create a separate Business Rule that will send SMS upon user account creation.

    • In Adaxes Administration Console, right-click your Adaxes service, point to New and click Business Rule.

    • Enter a name for the new Business Rule and click Next.
    • On the Triggering Operation page, select User in the Object Type list.
    • Select After and then select creating a user.

    • Click Next and follow instructions of the wizard.
  2. To add a Send SMS action to the Business Rule, do the following:

    • Click Add new action set.

    • Right-click Do nothing and select Add Action in the context menu.

    • In the Add Action dialog, select the Send SMS action.

    • In the To field, enter %mobile%.

      Value reference %mobile% will be replaced with the value of the Mobile Phone property of user accounts.

    • In the SMS text field, enter the SMS message text. For example:

       Username: %username% Password: %unicodePwd%

      You can use value references (e.g. %name%, %department%, %title%) in the SMS text. Before sending an SMS message, Adaxes will replace the value references with corresponding property values of the user's account. To include the user's password in the text, use %unicodePwd%.

    • When finished, click OK.
  3. Optionally, you may want the Business Rule to send SMS messages only if certain conditions are met. For example, to send SMS only if a mobile phone number is specified for the user, perform the following steps:

    • Right-click the action and select Add Condition in the context menu.

    • Select the If <property><relation><value> condition.

    • In the Condition Parameters section, specify Mobile Phone - is not empty.

    • Click OK.

    Make Mobile Phone Required

    To ensure a mobile number is specified for users in Active Directory, you can use Property Patterns to make Mobile Phone a required field.

    • Select built-in Property Pattern User Pattern.

    • In the section located to the right, click Add and select Mobile Phone in the drop-down list.

    • Check the The property is required checkbox.

    • Click OK and then click Save changes.

    Force Password Change

    It is highly recommended to force new users to change the initial password at the first logon. To force password change, the User must change password at next logon account option must be set.

    Using Property Patterns, you can specify the default values for user account options. For details, see Set Default Account Options for New Users.

    To prevent users from changing the default account options, you can customize the form used for creating user accounts. For details, see Customize Forms for User Creation and Editing.

  4. Click Save changes.

Send SMS using PowerShell Scripts

It is also possible to send SMS messages using PowerShell scripts:

	$mobilePhone = "%mobile%"
	if ([System.String]::IsNullOrEmpty($mobilePhone))
			$Context.LogMessage("Mobile phone is not specified.", "Warning")
	$smsText = "Username: %username% Password: %unicodePwd%"
	$Context.SendSms($mobilePhone, $smsText)

For instructions on how to execute a PowerShell script after a user account is created in Active Directory, see Run PowerShell Script after Creating a User

For information on how to create scripts for Business Rules, see Server-Side Scripting.

Open tutorial filtering

Got questions?
Support Questions & Answers