Skip to content

Command exit events

Ryan Newington edited this page Sep 4, 2025 · 7 revisions

Command Exit Events

Command exit events provide a way for a class constructor to call an external program in response to specified conditions being met. Any command line application can be executed.

As with all events, the execution conditions must be met for the event to be raised.

Parameters

Event Name

All events must have a unique name that is used to identify the event.

Event Is Disabled

Events can be disabled to prevent them from being raised and executed.

Command to Execute

Specify the path and executable file to run.

Arguments

The command-line arguments to pass the executable. Please note that as this uses ACMA declarative language, certain characters must be escaped to be passed to the command line.

Execute Event Asynchronously

The external command can either be run synchronously or asynchronously. In synchronous mode, ACMA will wait for the process to exit before moving onto the next export object. In asynchronous mode, ACMA will run external commands on a separate thread, and continue to process export objects. ACMA will wait until all operations have completed before signaling to the FIM sync engine that the export has completed.

On Error

When exporting synchronously, you can abort the export operation on the object, and return an error to the sync engine. When exporting asynchronously, you can only log the error to the ACMA log file.

Configuration Examples

PowerShell Script Execution

Command: powershell.exe
Arguments: -File "C:\Scripts\ProcessUser.ps1" -Username "{sAMAccountName}" -Email "{mail}"
Execute Asynchronously: No

Batch File Execution

Command: C:\Scripts\CreateHomeDirectory.bat
Arguments: "{sAMAccountName}" "{department}"
Execute Asynchronously: Yes

Third-Party Application

Command: C:\Tools\UserProvisioning.exe
Arguments: /user "{displayName}" /id "{employeeNumber}" /dept "{department}"
Execute Asynchronously: No
On Error: Abort export

Technical Considerations

Performance

Synchronous execution blocks ACMA processing until the command completes, which can impact export performance for time-consuming operations. Asynchronous execution allows ACMA to continue processing other objects while commands run in parallel.

Error Handling

Synchronous commands can abort the export operation and return errors to the sync engine, providing strong error control. Asynchronous commands cannot abort exports but can log errors for monitoring purposes.

Security Context

Commands execute under the ACMA service account context. Ensure the service account has appropriate permissions for the commands being executed.

Argument Escaping

When using ACMA declarative language expressions in arguments, special characters may need escaping depending on the target application's command-line parsing requirements.

Clone this wiki locally