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.
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.
Launch Adaxes Administration Console.
Expand Adaxes service \ Configuration \ Property Patterns \ Builtin and select User Pattern.
In the section located to the right, click Add and select the Office property.
Select Must be one of the following values only and click Edit.
Specify the allowed values for the Office property.
If you want to make the Office property mandatory, check the The property is required checkbox.
Click Save changes.
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.
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, uncheck the Enabled checkbox. Disabled commands are not displayed in the user interface.
Select the User object type and click Next.
On the Parameters step click Next.
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:
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>.
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.
Optionally, add Else block to delete the address if no office is specified.
When done, click Next. On the Permissions page, click Finish.
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.
Select a Business Rule or a Scheduled Task that will execute the Custom Command.
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.
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.