Skip to content

New AcmaPresenceQuery

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

Ne```powershell

New-AcmaPresenceQuery -Attribute -Operator


## Parameters
### Attribute (String)
The name of the attribute to check for presence or absence
- Required: Yes
- Position: Named
- Pipeline input: No

### Operator (AcmaPresenceOperator)
The type of presence search to perform. Valid values include:
- `IsPresent` - Attribute has any value (not null/empty)
- `IsNotPresent` - Attribute has no value (null/empty)

Required: Yes
Position: Named
Pipeline input: No

## Return Type
Returns an `AcmaDBQueryObject` that can be used with `Get-AcmaObjects`

## Examples
### Check for objects with a manager assigned
```powershell
$query = New-AcmaPresenceQuery -Attribute "manager" -Operator IsPresent
$objects = Get-AcmaObjects $query

Find objects without an email address

$query = New-AcmaPresenceQuery -Attribute "mail" -Operator IsNotPresent
$objects = Get-AcmaObjects $query
```uery 
## Description
Creates a new query that searches for the presence or absence of an attribute value. This cmdlet generates a DBQueryObject that can be used with the [[Get-AcmaObjects]] cmdlet
## Syntax

New-AcmaPresenceQuery -AttributeName -Operator <IsPresent | NotPresent>

## Parameters
### AttributeName
The name of the attribute to query
### Operator
The type of presence search to perform. Valid values are IsPresent or NotPresent
## Return type
The cmdlet returns an AcmaDBQueryObject
## Examples
```powershell
$query = New-AcmaPresenceQuery -AttributeName "accountName" -Operator IsPresent
$objects = Get-AcmaObjects $query

Clone this wiki locally