-
Notifications
You must be signed in to change notification settings - Fork 4
New AcmaQuery
Ryan Newington edited this page Sep 4, 2025
·
7 revisions
Creates a new query that searches for a particular attribute value. This cmdlet generates a DBQueryObject that can be used with the Get-AcmaObjects cmdlet
New-AcmaQuery -Attribute <string> -Operator <AcmaComparisonOperator> -Value <object>
New-AcmaQuery -Attribute <string> -Operator <AcmaComparisonOperator> -Declaration <string>The name of the attribute to query
- Required: Yes
- Position: Named
- Pipeline input: No
The type of comparison operation to perform. Valid values include:
-
Equals- Exact match -
NotEquals- Does not equal -
Contains- Contains the specified value -
NotContains- Does not contain the specified value -
StartsWith- Starts with the specified value -
EndsWith- Ends with the specified value -
GreaterThan- Greater than (numeric/date comparison) -
GreaterThanOrEquals- Greater than or equal to -
LessThan- Less than (numeric/date comparison) -
LessThanOrEquals- Less than or equal to -
IsPresent- Attribute has any value -
IsNotPresent- Attribute has no value
Required: Yes Position: Named Pipeline input: No
The value to compare against the attribute
- Required: Yes (when not using Declaration)
- Position: Named
- Pipeline input: No
- Accepts: String, Integer, DateTime, Boolean, or other appropriate type
A declarative expression to evaluate for the comparison value
- Required: Yes (when not using Value)
- Position: Named
- Pipeline input: No
Returns an AcmaDBQueryObject that can be used with Get-AcmaObjects
$query = New-AcmaQuery -Attribute "accountName" -Operator StartsWith -Value "r"
$objects = Get-AcmaObjects $query$query = New-AcmaQuery -Attribute "deleted" -Operator GreaterThan -Value 0
$objects = Get-AcmaObjects $query$query = New-AcmaQuery -Attribute "department" -Operator Equals -Value "Finance"
$objects = Get-AcmaObjects $query$query = New-AcmaQuery -Attribute "mailNickname" -Operator Equals -Declaration "{givenName}.{sn}"
$objects = Get-AcmaObjects $query$query = New-AcmaQuery -Attribute "manager" -Operator IsPresent
$objects = Get-AcmaObjects $query