Automatically set address based on user's office
In this tutorial, you will learn how to configure Adaxes to automatically update address information of user accounts based on their Office property. When a new user is created, Adaxes will automatically fill the Country, State, City, Street Address, and Zip/Postal Code properties of the user. When the Office property is changed, Adaxes will update all the address-related properties to correspond to the new office. To ensure that all users always have the correct address set, the address information will also be updated on a periodic basis.
Make Office field a drop-down list
Adaxes allows you to define a list of possible values for any property. If property values are limited to a predefined list, users will have to select a value from a drop-down instead of entering a value in a regular input field.
For information on how to define allowed values for properties, see Make an input field a drop-down list.
Create custom command
A custom command is a convenient way to configure all actions and conditions for updating the address in one place. It can then be used in business rules and scheduled tasks to update the address when a new user is created, when the Office property of an existing user is changed, and on a periodic basis.
-
Launch Adaxes Administration console.
How { #collapse1}
-
On the computer where Adaxes Administration console is installed, open Windows Start menu.
-
Click Adaxes Administration Console.
-
-
Right-click your Adaxes service, point to New and click Custom Command.
-
Enter a name for the new custom command.
-
Since the custom command will be executed by business rules and scheduled tasks only, clear the Enabled checkbox. Disabled commands are not displayed in the user interface.
Click Next.
-
Select the User object type.
-
Click Next two times.
-
On the Actions step, click Add an action.
-
Select the Update the user action.
In the Action Parameters section, click Add.
-
In the Property to modify drop-down, select Country.
In the New value field, specify a 2-letter country code (e.g. US, DE) and click OK.
Add modifications for the following properties:
-
Country Name
-
Country Code
-
State/Province
-
City
-
Street Address
-
Zip/Postal Code
Click OK.
-
-
Right-click the newly added action and then click Add Condition in the context menu.
-
Select the If <property> <relation> <value> condition.
In the Condition Parameters section specify Office - equals - <Office Name>.
Click OK.
-
Right-click the condition/action block and then click Copy in the context menu. To copy the whole block, make sure no actions or conditions are selected.
Right-click the condition/action block again and click Paste in the context menu.
Double-click the action and condition in the new Else If block and configure them for another office.
Repeat the steps above for each office.
To move an Else If block up and down, select it, and use the buttons. To move the whole block, make sure no actions or conditions are selected.
Optionally, add an Else block to delete the address if no office is specified.
When done, click Next.
-
On the Permissions page, click Finish.
Automate command execution
Now you need to configure Adaxes to automatically execute the custom command when a new user is created, when the Office property of an existing user is modified, and on a schedule.
-
Select a business rule or a scheduled task that will execute the custom command.
To execute the custom command after a new user account is created, you can use a built-in business rule, After user creation. For details on how to configure and activate the rule, see Automate user provisioning.
For instructions on how to create a scheduled task, see Schedule tasks for directory management.
-
Click Add new action set.
-
Right-click Do nothing and then click Add Action in the context menu.
-
In the Add Action dialog, select Execute a Custom Command.
In the Action Parameters section, select the custom command.
Click OK.
-
If the custom command is executed in a business rule triggered after updating a user, add the If the Office property has changed condition.
Add the custom command to other business rules and scheduled tasks.