Query AD activity

The Query AD activity retrieves entries from the Windows Active Directory based on an LDAP search filter and stores the results as a JSON string that can be used in the data bus.

To access this activity in the workflow editor, select the Custom tab, and then navigate to Custom Activities > Active Directory > .
Note: This activity replaces an AD activity by the same name available in releases prior to Geneva. If you have a workflow that uses the deprecated activity, your workflow will continue to work normally after upgrading to Instanbul and will continue to save query results to the scratchpad. However, all new workflows must use the custom version of this activity. This activity was built with the Create a PowerShell activity, which stores input and output variables in the databus instead of the scratchpad.

Input variables

Table 1. Query AD input variables
Variable Description
DomainController IP address of the domain controller machine.
Properties A comma-separated list of Active Directory properties to return. For example, givenName,SN,title. If this field is blank, then all properties are returned.
SearchFilter An LDAP filter string that defines the search parameters. Use any valid LDAP filtering criteria. For example, to find user accounts matching the ServiceNow input record, use:

Output variables

Table 2. Query AD output variables
Variable Description
result Either success or failure.
errorMessage The executionResult.errorMessages from the Activity designer parsing sources.
output The query result.


Table 3. Query AD conditions
Condition Description
Success The query completed as expected.
Failure An error occurred while processing the query. Additional details may be available in the workflow log.