IAdmLocationCondition
The IAdmLocationCondition interface represents the If located under <location> condition.
Inheritance: IAdmCondition
Properties
-
Property
-
Description
-
IsOperator
-
Gets or sets a value indicating whether an object should or should not be located under the specified container or organizational unit to meet the condition.
-
Container
-
Gets or sets a container that should or should not contain the object to meet the condition.
-
Scope
-
Gets or sets a value indicating whether an object should or should not be a direct child of the container or one of its descendants to meet the condition.
Details
IsOperator
Gets or sets a value indicating whether an object should or should not be located under the specified container or organizational unit to meet the condition.
- Type:
- ADM_ISOPERATOR_ENUM
- Access:
- Read/Write
Container
Gets or sets a container that should or should not contain the object to meet the condition.
- Type:
- IADsContainer
- Access:
- Read/Write
Examples
The following code sample creates a condition that returns true if the object is located directly under the London Staff organizational 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-LocationCondition") $locationCondition = $condition.GetCondition() $locationCondition.IsOperator = "ADM_ISOPERATOR_IS" $locationCondition.Scope = "ADS_SCOPE_ONELEVEL" $ouDN = "OU=London Staff,DC=company,DC=com" $ou = $service.OpenObject("Adaxes://$ouDN", $null, $null, 0) $locationCondition.Container = $ou # Save changes. $condition.SetCondition($locationCondition) $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-LocationCondition"); IAdmLocationCondition locationCondition = (IAdmLocationCondition)condition.GetCondition(); locationCondition.IsOperator = ADM_ISOPERATOR_ENUM.ADM_ISOPERATOR_IS; locationCondition.Scope = ADS_SCOPEENUM.ADS_SCOPE_ONELEVEL; const string ouDN = "OU=London Staff,DC=company,DC=com"; IADsContainer ou = (IADsContainer)service.OpenObject($"Adaxes://{ouDN}", null, null, 0); locationCondition.Container = ou; // Save changes. condition.SetCondition(locationCondition); condition.SetInfo(); actionSet.Conditions.Add(condition);
Remarks
When this property is set, the IAdmLocationCondition2::ContainerDnTemplate property is automatically set to null.
Scope
Gets or sets a value indicating whether an object should or should not be a direct child of the container or one of its descendants to meet the condition.
- Type:
- ADS_SCOPEENUM
- Access:
- Read/Write
Requirements
Minimum required version: 2009.1