Active Directory management & automation

Automatically Set Users' Address Based on Their Office

Very often, when creating or updating users in Active Directory, one has to fill in the same address information for different users. In this tutorial, you will learn how to configure Adaxes to automatically update the user address fields based on the user's office, and how to enable selection of offices from a drop-down list.

In this tutorial, we will modify the built-in Property Pattern called User Pattern to allow users to select values for the Office property from a predefined list. Then we will create a Custom Command that will update the user address information based on the value of the Office property of the user account. Then we will create two Business Rules to automatically execute this Custom Command after a new user is created and after the Office property of an existing user is updated. Also, we will create a Scheduled Task that will execute this Custom Command to update the user address information periodically (on a regular schedule).

Allow Users to Select Office from Drop-Down List

To allow users to choose an office from a drop-down list:

Launch Adaxes Administration Console, expand
Adaxes service \ Configuration \ Property Patterns \ Builtin and select User Pattern.

Selecting the built-in Property Pattern


In the Result Pane (located on the right):
  • Click the Add button located in the top right corner of the view.
  • Select the Office property in the drop-down list.

Property Pattern item context menu


In the Add Property Pattern Item dialog that opens, do the following:
  • Enable the Must be one of the following values only option.
  • Click the Edit button located next to this option.
  • In the Edit Value List dialog that opens, click Add to add office names to the list.

    If you want to force users to fill in the Office field, enable the The property is required option.

  • When finished, click OK.

When finished, click Save changes.

Save the Property Pattern

Create a Custom Command to Update User Addresses

To create a Custom Command that will update the user address information:

Launch Adaxes Administration Console, expand your Adaxes service, right-click Custom Commands, point to New and click Custom Command. The Create Custom Command wizard will open.

Launching the Create Custom Command wizard


Provide a name and brief description for the new Custom Command.

If you don't want the Custom Command to be available in the user interface, uncheck the Enabled check box (recommended).

Click Next.

On the Object Type page, select User and click Next.


On the Actions page you need to define the actions to be performed by the Custom Command. To update the address-related properties of user objects, do the following:
  • Click Add Action.
  • In the dialog that opens, select the Update the User action.
  • Click the Add button located in the Action Parameters section.

  • Select the Country Name property in the Property to modify combo box and type the name of the country where an office is located in the New value field.

  • Click OK
  • Perform the last steps for the following properties:
    • State/Province
    • City
    • Street Address
    • P.O.Box
    • Zip/Postal Code
  • Click OK.

Now we need to specify the condition that must be met for the new action to be executed. To perform the action only if the Office property of a user is set to Office A, do the following:
  • Right-click the action/condition set.
  • Select the Add Condition item in the context menu.

  • In the dialog that opens, select the If <property><relation><value> condition type.
  • In the Condition Parameters section, specify Office equals Office A.

  • Click OK.

Click the

Add action to a new set link and repeat steps 4 and 5 for the rest of the offices.

Automatically Execute the Custom Command on User Creation and Modification

Now we need to configure Adaxes to automatically execute the Custom Command when a new user is created and when the Office property of an existing user is modified.

Create a Business Rule that will be executed after creation of new users in Active Directory. Add the Execute Custom Command action to this Business Rule that will execute the Custom Command.

Active Directory Automation: After User Creation

On how to create a Business Rule triggered after creation of new users, see
Run PowerShell Script after Creating a User.

Create a Business Rule that will be executed after updating users and add the Execute Custom Command action to this Business Rule. To execute the Custom Command only if the Office property has changed, add the If the 'Office' property has changed condition to the Business Rule.

Active Directory Automation: After User Update

Update User Addresses on Schedule

In order to update the address information of the users that were created or modified outside of Adaxes, you can create a Scheduled Task that will periodically execute the Custom Command.

Active Directory Automation: Scheduled Task

For details on how to create Scheduled Tasks, see Schedule Tasks for Active Directory Management.

? Waiting

Progress status: Checking...