Automatically Set Address Based on User's Office

In this tutorial, you will learn how to configure Adaxes to automatically update address information in Active Directory based on the Office property of user accounts. When a new user is created, Adaxes will automatically fill the Country, State, City, Street Address, PO Box 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 of Active Directory objects, including property Office. If property values are limited to a predefined list, users can select a value from a drop-down box, instead of entering the value in a regular input field.

To define allowed values for Active Directory object properties, you need to use Property Patterns. Adaxes provides built-in Property Pattern User Pattern that is by default applied to all user accounts. You can use the Property Pattern to define a list of possible values for the Office property.

  1. Launch Adaxes Administration Console.

    Expand Adaxes service \ Configuration \ Property Patterns \ Builtin and select User Pattern.

  2. In the section located to the right, click Add and select the Office property.

  3. Select Must be one of the following values only and click Edit.

    Specify the allowed values for the Office property.

    Click OK.

  4. If you want to make the Office property mandatory, check the The property is required checkbox.

  5. Click Save changes.

Create Custom Command

The address information must be updated when a new user is created, when the Office property of an existing user is changed and on a periodic basis. Since the same update rules must be applied when different events take place, you need to create a Custom Command that will contain all the necessary actions and conditions, and then execute the command in different Business Rules and Scheduled Tasks.

  1. Right-click your Adaxes service, point to New and click Custom Command.

    Enter a name for the new Custom Command.

  2. Since the Custom Command will be executed by Business Rules and Scheduled Tasks only, uncheck the Enabled checkbox. Disabled commands are not displayed in the user interface.

    Click Next.

  3. Select the User object type and click Next.

  4. On the Parameters step click Next.

  5. On the Actions step click Add an action.

    Select the Update the User action.

    Click Add in the Action Parameters section.

    Select the Country property, specify a 2-letter country code (e.g. US, DE) in the New value field and click OK.

    Add modifications for the following properties:

    • Country Name
    • Country Code
    • State/Province
    • City
    • Street Address
    • P.O.Box
    • Zip/Postal Code

    Click OK.

  6. Right-click the newly added action and select 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.

  7. Right-click the condition/action block and select Copy in the context menu. To copy the whole block, make sure no actions and conditions are selected.

    Right-click the condition/action block again and select Paste in the context menu.

    Double-click the action and condition in the pasted 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 and conditions are selected.

    Optionally, add Else block to delete the address if no office is specified.

  8. 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 scheduled basis.

  1. 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 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 AD Management.

  2. Click Add new action set.

    Right-click Do nothing and select 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.

  3. 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.

Open tutorial filtering

Got questions?
Support Questions & Answers