Move Newly Created Users to a Specific OU
Adaxes allows you to automatically move Active Directory objects to specific OUs or containers when an object is created, modified, disabled, etc. In this tutorial you will learn how to configure Adaxes to automatically move newly created users to a specific OU based on the user's city.
To automatically move new users to a specific AD location, you need to create a Business Rule that will be executed after a new user account is created in Active Directory.
Launch Adaxes Administration Console, right-click your Adaxes service, point to New and click Business Rule . The Create Business Rule wizard will open.
Enter the name for the new Business Rule and click Next.
Here you need to specify when the new Business Rule must be executed. As we want to move user accounts after their creation, do the following:
- Select User in the Object Type list.
- Select After in the Operation section.
- Select Creating a User in the Operation section and click Next.
At the next step, you need to specify what the Business Rule will do when a new user is created. To add the Move the User action to the Business Rule, do the following:
- Click the Add Action link.
- In the dialog that opens, select the Move the User action.
- In the Action Parameters section click Select Location and select the OU or container you want to move newly created users to. Click OK.
To move users to the specified OU, if the office of these users is located in a specific city only, you need to add a condition to the Move the User action:
- Select the action/condition set (click the created action to highlight the set), and click the Add Condition icon.
- In the dialog that opens, select the If<property><relation><value> condition type.
- In the Condition Parameters section specify, for example, City equals New York , and click OK.
- Create a Property Pattern for User objects.
- Add a Property Pattern item for the City property.
- Select the The property is required option.
- Specify the names of cities in the Must be one of the following values only field.
- Optionally, set the default city in the Generate default value field.
To move users from other cities to other OUs, click the Add action to a new set link and repeat steps 4 and 5. When finished, click Next.
Here, at the Activity Scope page you need to specify where in Active Directory a user must be created to trigger this Business Rule. Click Add.
In the Business Rule Activity Scope dialog that opens, you need to specify the Active Directory locations where the Business Rule will be effective. Select one of the following items:
All Objects - select if you want this Business Rule to be executed when a
user is created in any AD domain managed by the Adaxes service.
Specific Domain - select if you want this Business Rule to be executed when
a user is created in the AD domain you specify.
- OU or Container - select if you want this Business Rule to be executed only when a new user is created under the selected OU or container.
Select the item you need and click Add. When finished, click OK.
The specified activity scope items will be displayed in the Assignments list. Click Finish.
Now, when the Business Rule is complete, every time a new user is created in AD (no matter in which way - using Administration Console, Web Interface, during data import, via PowerShell scripts, etc.), Adaxes will automatically move this user to the OU you specify.
Move Users after Creation, Modification and by Schedule
If your Active Directory object location policies depend on user account properties or on the user group membership, you may also need to move users between OUs after a user is updated or added/removed from a group.
For this purpose, you need to create a Custom Command that will move users according to certain rules, and then execute this Custom Command by Business Rules and Scheduled Tasks.
For details on how to create Custom Commands, see Create a Custom Command.