IAdmSimpleCriteriaItem

The IAdmSimpleCriteriaItem interface represents a simple criteria item used in Criteria. A simple criteria item is, effectively, a condition a directory object must meet to match the criteria.

Inheritance: IAdmCriteriaItem

Properties

  • Property

  • Description

  • Property

  • Gets or sets the directory object property to compare with the specified value(s).

  • Operator

  • Gets or sets the comparison operator.

  • Value

  • Gets or sets the value(s) for the specified property to match.

  • ValueLogicalOperator

  • Gets or sets the logical operator for evaluating multiple values.

Details

Property

Gets or sets the directory object property to to compare with the specified value(s). The property name must be specified exactly as it is defined in your directory schema e.g. physicalDeliveryOfficeName, accountExpires.

  • Type:
  • string
  • Access:
  • Read/Write

Examples

The following code sample creates a simple criteria item that matches objects with empty description.

PowerShell
$criteria = YOUR-CRITERIA

# Create a simple criteria item.
$simpleItem = $criteria.CreateSimple()
$simpleItem.Property = "description"
$simpleItem.Operator = "empty"
$simpleItem.Value = @($true)
C#
using Softerra.Adaxes.Directory.Criteria;
using Softerra.Adaxes.Interop.Adsi.Criteria;

class Program
{
    public static void Main()
    {
        IAdmSimpleCriteriaItem item = new SimpleCriteriaItem()
        {
            Property = "description",
            Operator = "empty",
            Values = { true }
        };
    }
}

Operator

Gets or sets the comparison operator. For a list of available comparison operators, see the Comparison operators section in the How to build criteria article.

  • Type:
  • string
  • Access:
  • Read/Write

Examples

The following code sample creates a simple criteria item matching objects that were created more than 30 days ago.

PowerShell
$criteria = YOUR-CRITERIA

# Create a simple criteria item.
$simpleItem = $criteria.CreateSimple()
$simpleItem.Property = "whenCreated"
$simpleItem.Operator = "occurredMoreThan"
$simpleItem.Value = @(30)
C#
using Softerra.Adaxes.Directory.Criteria;
using Softerra.Adaxes.Interop.Adsi.Criteria;

class Program
{
    public static void Main()
    {
        IAdmSimpleCriteriaItem item = new SimpleCriteriaItem()
        {
            Property = "whenCreated",
            Operator = "occurredMoreThan",
            Values = { 30 }
        };
    }
}

Value

Gets or sets the value(s) to compare with the value of the specified property.

  • Type:
  • object[]
  • Access:
  • Read/Write

Examples

The following code sample creates Criteria that matches all users from Contoso or Acme companies.

PowerShell
$criteria = YOUR-CRITERIA

# Create a simple criteria item.
$simpleItem = $criteria.CreateSimple()
$simpleItem.Property = "company"
$simpleItem.Operator = "eq"
$simpleItem.Value = @("Contoso", "Acme")
$simpleItem.ValueLogicalOperator = "OR"
C#
using Softerra.Adaxes.Directory.Criteria;
using Softerra.Adaxes.Interop.Adsi.Criteria;

class Program
{
    public static void Main()
    {
        IAdmSimpleCriteriaItem item = new SimpleCriteriaItem()
        {
            Property = "company",
            Operator = "eq",
            ValueLogicalOperator = LogicalOperator.Or
        };
        item.Value = new object[] { "Contoso", "Acme" };
    }
}

ValueLogicalOperator

Gets or sets the logical operator for evaluating multiple values specified in Values. The default logical operator is OR.

Examples

The following code sample creates a simple criteria item matching all objects whose description contains the words deprovisioned and admin.

PowerShell
$criteria = YOUR-CRITERIA

# Create a simple criteria item.
$simpleItem = $criteria.CreateSimple()
$simpleItem.Property = "description"
$simpleItem.Operator = "contains"
$simpleItem.Value = @("deprovisioned","admin")
$simpleItem.ValueLogicalOperator = "AND"
C#
using Softerra.Adaxes.Directory.Criteria;
using Softerra.Adaxes.Interop.Adsi.Criteria;

class Program
{
    public static void Main()
    {
        IAdmSimpleCriteriaItem item = new SimpleCriteriaItem()
        {
            Property = "description",
            Operator = "contains",
            Values = { "deprovisioned", "admin" },
            ValueLogicalOperator = LogicalOperator.And
        };
    }
}

Requirements

Minimum required version: 2023

See also