With the help of Custom Commands, users can perform operations that require multiple steps in one single action. For example, when a user goes on vacation, a single command can be used to add the user to a group, send an email notification to the user's manager, set an out-of-office message on the user's mailbox, disable the user's account, etc.
Users can execute Custom Commands in the same way they execute other operations in Adaxes Web Interface and Administration Console.
In this tutorial, you will learn how to create and configure a Custom Command.
Launch Adaxes Administration Console, expand your Adaxes service, right-click Custom Commands, point to New and click Custom Command.
Enter a name for the new Custom Command, select an icon, provide description and confirmation text.
Select the type of objects on which the command will be performed. To execute the command on user accounts, select the User object type.
On this step, you can add parameters to the Custom Command. Parameters can be used to supply additional information that can be necessary to execute the command.
To perform different actions based on parameter values, you can use the If <parameter><value> condition:
With the help of value references (e.g. %param-MyParam%) parameter values can be used in actions and conditions:
It is also possible to use parameter values in PowerShell scripts. For instance, you can set a script variable to a parameter value as follows:
$var = "%param-MyParam%" # Alternatively, you can use the GetParameterValue method of the $Context variable: $var = $Context.GetParameterValue("param-MyParam")
To add a parameter, click New and follow the instructions of the New Parameter wizard.
When done, click Next.
Specify what actions the command should perform. To add an action, click Add an action.
Select the action you need in the list and configure action parameters and execution options.
To cancel the execution of the Custom Command, select the Cancel this operation action. In the following example, command execution is cancelled if the account of the user is disabled.
To request approval for command execution, select the Send this operation for approval action. In the following example, approval is requested if the initiator is not a member of group Administrators.
When finished, click OK.
To add more actions to the command, right-click a condition/action set and click Add Action in the context menu.
Actions are executed sequentially according to their order in the set. To move an action up and down, select it, and use the buttons.
To execute actions only if certain conditions are met, right-click the action set, and click Add Condition in the context menu.
If there are 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 if at least one condition is met. To change the operator, click on it.
You can use Else If and Else blocks to avoid duplication of conditions for different sets of related but mutually exclusive actions.
The Else block is useful when you need to perform some actions on specific conditions, and different actions in all other cases.
To add Else If and Else blocks to a set of actions, right-click it and select Add Else and Add Else If in the context menu.
To perform different actions for different conditions, you need to add a separate set of actions and then assign the necessary conditions to it. To add a set of actions, click Add new action set.
Sets of actions are executed in a sequential order. To change the order, select a set and use the buttons. To move the whole set, make sure no actions and conditions are selected.
When finished, click Next.
To execute Custom Commands, users must have appropriate permissions. At this step of the wizard, you can select the Security Roles to which you want to add the permission to execute the new Custom Command.
You can skip this step and configure the permissions later. For details, see Grant Rights to Execute Custom Commands.
For instructions on how to place a Custom Command on the Actions pane in the Web Interface, see Configure Actions Pane.
For instructions on how to disable a Custom Command in the Web Interface, see Disable Operations on AD objects.
To completely disable a Custom Command, right-click it, 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.