Applies to: Cayosoft Administrator all versions
Summary: Many automation rules are supplied with the Query Criteria and post-query Filter settings to refine the list of objects that will be affected by the rule when it is executed. There is a point-and-click Query Builder dialog provided to simplify configuring both Query Criteria and Filter.
Query Criteria may dramatically improve performance because the criteria is sent to the target system - to AD or Office 365 - with the query. It may result in a significantly reduced amount of data that must be sent over the network and processed by rule. Plus, target systems are usually apply indexing, caching and other optimization functions to provide optimal query performance. That is why Query Criteria attribute list is limited to what target system supports for query conditions.
Post-query Filters are more flexible, and supports all the attributes that can be returned from the target system. But Filter conditions are applied by Cayosoft Administration Service only after all the data has been returned from Active Directory or Office 365.
Since Query Criteria and post-query Filter work differently, there are certain considerations to keep in mind when constructing conditions with Criteria Builder.
In this article:
- Criteria Builder operators for Query Criteria
- Criteria Builder operators for post-query Filter
IMPORTANT: both Query Criteria and Filter are case insensitive.
Criteria Builder operators for Query Criteria
'Equal' and 'Not equal' operators
If you need to filter objects that have (not have) a specific attribute value, you need to use Equal (Not equal) operator.
1. Find all users with Office 'New York' you should use this condition:
2. Find all objects that do not have Office 'New York' and are not empty you need to use Not equal:
3. Find all enabled AD users
'Like' and 'Not like' string matching operators
You need to use 'Like' ('Not Like') operators in combination with wildcard (*) expressions to find objects that match (do not match) a specified pattern.
Note: placeholder for a single character ('?') is not supported.
1. Find all users who have extensionAttribute1 ends with 'svc', you should use this condition:
2. Find all users who have Department starts with '_internal':
3. Find all users who have Department name containing 'temp', so it does not matter if 'temp' is at the beginning of the string, at the end or in the middle:
4. Find all users with empty City attribute:
5. Find all users with not empty Office Phone attribute:
6. Find all AD users who have email or SIP or other address ended with suffix '@mail.onmicrosoft.com' within their proxyAddresses attribute
'Contains' and 'Not contains' operators
Operators 'Contains' and 'Not contains' are not supported in Query Criteria.
Criteria Builder operators for post-query Filter
Note: To filter by a specific attribute, you should also add this attribute to the list of Returned Properties in the automation rule. Otherwise, objects in the result set would not contain this attribute and filter conditions would treat the value as "not set" or $null.
'Equal', 'Not equal', 'Like' and 'Not like' operators
Filter also supports all operator types described for Query Criteria ('Equals', 'Not equals', 'Like', 'Not like'), but there is a little difference when you want to find objects with empty and not empty attribute values. To find empty values using Filter you need to compare the attribute with $null.
1. Find users with empty City attribute:
2. Find users with not empty Department:
'Contains' and 'Not contains' operators
To perform search within an array or multi valued attribute like PropxyAddress you need to use the containment operators ('Contains' and 'Not contains'). These advanced operators are hidden by default, to enable them in the condition builder, hold "Shift" button on the keyboard when clicking on the selector […] button.
Note: wildcards (*) are not supported for 'Contains' and 'Not contains' operators.
1. Find all users whose have one of the attribute otherTelephone values '111':
2. Find all users with c attribute from the list of possible values: "AF","DZ","AO","AZ:
Advanced filtering with multi valued attributes
Post-query Filter is more flexible then Query and if you need to check if multi valued attribute is empty or contains more then specific number of values you can use .Count property.
1. Find all users with empty proxyAddress attribute:
2. Find all users that have more than 2 proxyAddresses: