Create a Custom Command
It often happens that you regularly need to perform a similar set of actions to accomplish a particular task in Active Directory. For example, each time a user is assigned to a project, you need to add this user to a certain AD group, send an e-mail with some instructions to this user, update user properties, execute a script, etc.
Adaxes enables you to define your own Custom Commands to perform complex and routine Active Directory management tasks at the click of a mouse. Users can execute Custom Commands in the same way they execute any other operations in the Adaxes Administration Console or Web Interface. In this tutorial, you will learn how to create a Custom Command in Adaxes and grant rights to users to execute this Custom Command.
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.
Provide the name (label), icon, brief description, and confirmation text for the new Custom Command. Click Next.
On this page, you need to choose the type of Active Directory objects, on which the new Custom Command will be executed. To create a Custom Command to be performed on user objects, select User in the Object type list, and click Next.
At the next step, you need to specify the actions to be performed, when the Custom Command is initiated. To add an action, do the following:
- Click the Add Action link.
- Select the action you need in the list (at the top of the dialog).
- Define the action parameters and execution options.
- Click OK.
If necessary, define other actions for the Custom Command. To add an action, select the action/condition set (click the created action to highlight the set), and click the Add Action icon.
Optionally, you may want the Custom Command to execute the specified actions, only if certain conditions are met. For example, to execute the actions only on users, whose accounts are not disabled, perform the following steps:
- Select the action/condition set, and click the Add Condition icon.
- In the dialog that opens, select the If account is <status> condition type.
- In the Condition Parameters section select enabled.
- Click OK.
If you add two or more conditions, they are combined by AND/OR operator. If conditions are combined by the AND operator, the actions are executed provided that all conditions are met. If conditions are combined by the OR operator, the actions are executed provided that at least one condition is met. To change the operator, just click it.
To execute different actions for different conditions, click the Add action to a new set link and repeat steps from 4 to 6. When finished, click Next.
Sets of actions and conditions are executed in a sequential order. To change the order of their execution, select the set you need (make sure no action or condition is selected), and click Move Up or Move Down icon below.
When finished, click Next.
At the next step, you can specify, which Security Roles will grant the permission to execute the new Custom Command. The users and groups, assigned to the selected Security Roles, will be able to perform the new Custom Command within the scope of their authority.
- Click the Select Roles button.
- Select the Security Roles, to which you want to add the permission to execute the new Custom Command.
- Click OK.
Now, when the Custom Command is complete, users will be able to execute this Custom Command in the same way they execute any other operations in the Adaxes Administration Console or Web Interface:
The Web Interface can be configured to allow execution of frequently-used Custom Commands right from the Home page. For details, see Configure Home page actions.
To disallow execution of a Custom Command in the Web Interface, see Disallow certain operations on AD objects.
To completely disable a Custom Command, right-click the command you need, point to All Tasks, and click Disable.
Disabled Custom Commands are not displayed in the user interface, but can be executed by Business Rules, Scheduled Tasks, and other Custom Commands.