IAdmDirectoryTypeCondition

The IAdmDirectoryTypeCondition interface represents the If the directory type is AD / Entra ID condition.

Inheritance: IAdmCondition

Properties

  • Property

  • Description

  • DirectoryType

  • Gets or sets the type of the directory the object should be located in to meet the condition.

Details

DirectoryType

Gets or sets the type of the directory the object should be located in to meet the condition.

Examples

The following code sample creates a condition that returns true if the target object is from an on-premises Active Directory domain.

PowerShell
# The $actionSet variable refers to an action set in a
# business rule, custom command, or scheduled task.

# Create condition.
$condition = $actionSet.Conditions.CreateEx("adm-DirectoryTypeCondition")
$directoryTypeCondition = $condition.GetCondition()
$directoryTypeCondition.DirectoryType = "OnPremise"

# Save changes.
$condition.SetCondition($directoryTypeCondition)
$condition.SetInfo()
$actionSet.Conditions.Add($condition)
C#
// The actionSet variable refers to an action set in a
// business rule, custom command, or scheduled task.

// Create condition.
IAdmBusinessRuleCondition condition = (IAdmBusinessRuleCondition)actionSet.Conditions.CreateEx(
    "adm-DirectoryTypeCondition");
IAdmDirectoryTypeCondition directoryTypeCondition = 
    (IAdmDirectoryTypeCondition)condition.GetCondition();
directoryTypeCondition.DirectoryType = DirectoryType.OnPremise;

// Save changes.
condition.SetCondition(directoryTypeCondition);
condition.SetInfo();
actionSet.Conditions.Add(condition);

Requirements

Minimum required version: 2023

See also