IAdmTrusteeUserCondition

The IAdmTrusteeUserCondition interface represents the If the initiator is <user> condition.

Inheritance: IAdmCondition

Properties

  • Property

  • Description

  • IsOperator

  • Gets or sets a value indicating whether the operation initiator should or should not be the specified user to meet the condition.

  • User

  • Gets or sets the user the operation initiator should or should not be to meet the condition.

Details

IsOperator

Gets or sets a value indicating whether the operation initiator should or should not be the specified user to meet the condition.


User

Gets or sets the user the operation initiator should or should not be to meet the condition.

Remarks

When this property is set, the IAdmTrusteeUserCondition2::UserDnTemplate property is automatically set to null.

Examples

The following code sample creates a condition that returns true if the initiator is not John Smith.

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-TrusteeUserCondition")
$trusteeUserCondition = $condition.GetCondition()
$trusteeUserCondition.IsOperator = "ADM_ISOPERATOR_ISNOT"

$userDN = "CN=John Smith,CN=Users,DC=domain,DC=com"
$user = $service.OpenObject("Adaxes://$userDN", $null, $null, 0)
$trusteeUserCondition.User = $user

# Save changes.
$condition.SetCondition($trusteeUserCondition)
$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-TrusteeUserCondition");
IAdmTrusteeUserCondition trusteeUserCondition =
    (IAdmTrusteeUserCondition)condition.GetCondition();
trusteeUserCondition.IsOperator = ADM_ISOPERATOR_ENUM.ADM_ISOPERATOR_ISNOT;

const string userDN = "CN=John Smith,CN=Users,DC=domain,DC=com";
IADsUser user = (IADsUser)service.OpenObject($"Adaxes://{userDN}", null, null, 0);
trusteeUserCondition.User = user;

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

Requirements

Minimum required version: 2009.1

See also