IAdmBusinessUnitMembershipCondition

The IAdmBusinessUnitMembershipCondition interface represents the If the object belongs to <business unit> condition.

Inheritance: IAdmCondition

Properties

  • Property

  • Description

  • IsOperator

  • Gets or sets a value indicating whether the object should or should not be a member of the business unit to meet the condition.

  • BusinessUnit

  • Gets or sets the business unit the object should or should not be a member of to meet the condition.

Details

IsOperator

Gets or sets a value indicating whether the object should or should not be a member of the specified business unit to meet the condition.


BusinessUnit

Gets or sets the business unit the object should or should not be a member of to meet the condition.

Examples

The following code sample creates a condition that returns true if the initiator is a member of the Interns business unit.

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-BusinessUnitMembershipCondition")
$businessUnitCondition = $condition.GetCondition()
$businessUnitCondition.IsOperator = "ADM_ISOPERATOR_IS"

# Bind to the business unit.
$containerPath = $service.Backend.GetConfigurationContainerPath("BusinessUnits")
$pathObj = New-Object "Softerra.Adaxes.Adsi.AdsPath" $containerPath
$unitPath = $pathObj.CreateChildPath("CN=Interns")
$unit = $service.OpenObject($unitPath.ToString(), $null, $null, 0)

$businessUnitCondition.BusinessUnit = $unit

# Save changes.
$condition.SetCondition($businessUnitCondition)
$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-BusinessUnitMembershipCondition");
IAdmBusinessUnitMembershipCondition businessUnitCondition =
    (IAdmBusinessUnitMembershipCondition)condition.GetCondition();
businessUnitCondition.IsOperator = ADM_ISOPERATOR_ENUM.ADM_ISOPERATOR_IS;

// Bind to the business unit.
string containerPath = service.Backend.GetConfigurationContainerPath("BusinessUnits");
AdsPath pathObj = new AdsPath(containerPath);
AdsPath unitPath = pathObj.CreateChildPath("CN=Interns");
IAdmBusinessUnit unit = (IAdmBusinessUnit)service.OpenObject(unitPath.ToString(), null, null, 0);

businessUnitCondition.BusinessUnit = unit;

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

Requirements

Minimum required version: 2019.1

See also