# Invoker interface

Any agent, trigger or mapping can use the invoker method for the ActiveDirectory agent. The invoker method is available in the dispatcherService class as well as the in the serverService.

The invoker method is not specific of the Shell agent. Many other connectors support this method. The expected arguments are:

- Action
- Object name
- Parameters

Here you have an example of a post-update trigger to create the home server for a user:

```Java
map = new HashMap();
map.put("user", source{"accountName"});
// Create folder
dispatcherService.invoke("invoke", "mkdir /home/${user}", map);
dispatcherService.invoke("invoke", "mkdir /home/${user}/Desktop", map);
```

There is a chance to execute operation across agents. For instance, if the system has an ActiveDirectory agent and an Exchange agent, here is a post-insert trigger to place in the post-insert trigger of the ActiveDirectory agent to execute a command in the Exchange one.

```Java
map = new HashMap();
map.put("user", source{"accountName"});
// Create folder
serverService.invoke("Exchange", "invoke", "EnableMailbox ${user}", map);
```

The list of allowed commands are:

<div id="bkmrk-command-object-name-"><table class="confluenceTable tablesorter tablesorter-default" role="grid"><colgroup><col></col><col></col><col></col><col></col></colgroup><thead><tr class="tablesorter-headerRow" role="row"><th aria-disabled="false" aria-label="Command: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="0" role="columnheader" scope="col" style="width: 97px;" tabindex="0">**Command**

</th><th aria-disabled="false" aria-label="Object name: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="1" role="columnheader" scope="col" style="width: 171px;" tabindex="0">**Object name**

</th><th aria-disabled="false" aria-label="Parameters: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="2" role="columnheader" scope="col" style="width: 183px;" tabindex="0">**Parameters**

</th><th aria-disabled="false" aria-label="Comments: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" colspan="1" data-column="3" role="columnheader" scope="col" style="width: 361px;" tabindex="0">**Comments**

</th></tr></thead><tbody aria-live="polite" aria-relevant="all"><tr role="row"><td class="confluenceTd" style="width: 97px;">invoke

</td><td class="confluenceTd" style="width: 171px;">Sentence to execute

</td><td class="confluenceTd" style="width: 183px;">Sentence parameters

</td><td class="confluenceTd" colspan="1" style="width: 361px;">Executes the command and return the results

</td></tr></tbody></table>

</div>