IAdmMemberBusinessUnitMembershipCondition

The IAdmMemberBusinessUnitMembershipCondition interface represents the If the member belongs to <business unit> condition, which is available in business rules before/after adding/removing a member from a group.

Inheritance: IAdmBusinessUnitMembershipCondition

Properties

  • Property

  • Description

  • IsOperator

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

  • BusinessUnit

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

Details

IsOperator

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


BusinessUnit

Gets or sets the business unit the group member 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 new member is also a member of the Interns business unit.

PowerShell
# The $actionSet variable refers to an action set in a
# before/after adding/removing a member from a group business rule.

# 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
// before/after adding/removing a member from a group business rule.

// Create condition.
IAdmBusinessRuleCondition condition = (IAdmBusinessRuleCondition)actionSet.Conditions.CreateEx(
    "adm-MemberBusinessUnitMembershipCondition");
IAdmMemberBusinessUnitMembershipCondition businessUnitCondition =
    (IAdmMemberBusinessUnitMembershipCondition)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