Create custom command

With the help of custom commands, users can perform complex multi-step operations 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.

  1. Launch Adaxes Administration console.

     How { #collapse1}
    • On the computer where Adaxes Administration console is installed, open Windows Start menu.

    • Click Adaxes Administration Console.

  2. Expand your Adaxes service, right-click Custom Commands, point to New and click Custom Command.

  3. Enter a name for the new custom command, select an icon, provide description and confirmation text.

    Click Next.

  4. Select the type of objects (e.g. User) for which the command can be executed.

    Click Next.

  5. On this step, you can add parameters to the custom command. Parameters can be used to supply additional information that might be necessary to execute the command.

     How to use parameters { #how_to_use_parameters}

    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 like so:

    $var = "%param-MyParam%"
    
    # Alternatively, you can use the GetParameterValue method
    # of the $Context variable:
    $var = $Context.GetParameterValue("param-MyParam")
    

    When done, click Next.

  6. Click Add an action.

  7. Select the action you need, 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 the 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 the Administrators group.

    When done, click OK.

  8. 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.

  9. 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 the 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 it.

    Else If and Else blocks

    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 then click Add Else and Add Else If in the context menu.

  10. 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 done, click Next.

  11. On the Permissions step, select the security roles where 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.

    Click Finish.


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 directory 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.