Skip to content

IAdmBusinessRule

The IAdmBusinessRule interface represents a Business Rule, Custom Command, or Scheduled Task.

Inheritance: The IAdmBusinessRule interface inherits from the IAdmTop interface.

Methods

  • Method

  • Description

  • IsInScope()

  • Checks whether the given directory object is affected by the Business Rule.

Properties

  • Property

  • Description

  • RuleName

  • Gets the name of the Business Rule.

  • Description

  • Gets or sets an optional description for the Business Rule.

  • ObjectType

  • Gets or sets the type of directory objects to which the Business Rule is applied.

  • OperationType

  • Gets or sets the type of the operation that will trigger the Business Rule.

  • ExecutionMoment

  • Gets or sets a value that indicates when the Business Rule is to be executed.

  • ConditionedActions

  • Gets conditions and actions defined for the Business Rule.

  • ActivityScopeItems

  • Gets a collection of scope items that represent the activity scope of the Business Rule.

  • Disabled

  • Gets or sets a value that indicates whether the Business Rule is disabled.

Details

IsInScope()

Checks whether the given directory object is affected by the Business Rule.

Boolean IsInScope(IAdmTop object)

Parameters

The object parameter is the directory object to be checked.

Examples

The following code sample checks whether a user is affected by a Business Rule.

[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")

# Connect to the Adaxes service
$admNS = New-Object "Softerra.Adaxes.Adsi.AdmNamespace"
$admService = $admNS.GetServiceDirectly("localhost")

# Bind to the user
$userDN = "CN=John Smith,CN=Users,DC=domain,DC=com"
$user = $admService.OpenObject("Adaxes://$userDN", $NULL, $NULL, 0)

# Bind to the Business Rule
$businessRulesPath = $admService.Backend.GetConfigurationContainerPath(
    "BusinessRules")
$businessRulesPathObj = New-Object "Softerra.Adaxes.Adsi.AdsPath" `
    $businessRulesPath
$myRuleAdsPath = $businessRulesPathObj.CreateChildPath( `
    "CN=My Rule")

$rule = $admService.OpenObject($myRuleAdsPath, $NULL, $NULL, 0)

if ($rule.IsInScope($user))
{
    Write-Host "The Business Rule affects" $user.Get("name")
}
else
{
    Write-Host "The Business Rule does not affect" $user.Get("name")
}
using System;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi;
using Softerra.Adaxes.Interop.Adsi.BusinessRules;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;

class Program
{
    static void Main(string[] args)
    {
        // Connect to the Adaxes service
        AdmNamespace adsNS = new AdmNamespace();
        IAdmService admService = adsNS.GetServiceDirectly("localhost");

        // Bind to the user
        const String userPath = "Adaxes://CN=John Smith,CN=Users,DC=domain,DC=com";
        IAdmTop user = (IAdmTop) admService.OpenObject(userPath, null, null, 0);

        // Bind to the Business Rule
        String businessRulesPath = admService.Backend.GetConfigurationContainerPath(
            "BusinessRules");
        AdsPath businessRulesPathObj = new AdsPath(businessRulesPath);
        AdsPath myRuleAdsPath = businessRulesPathObj.CreateChildPath("CN=My Rule");

        IAdmBusinessRule rule =
            (IAdmBusinessRule) admService.OpenObject(myRuleAdsPath.ToString(), null, null, 0);

        if (rule.IsInScope(user))
        {
            Console.WriteLine("The Business Rule affects {0}", user.Get("name"));
        }
        else
        {
            Console.WriteLine("The Business Rule does not affect {0}", user.Get("name"));
        }
    }
}

RuleName

Gets the name of the Business Rule.

  • Type:
  • String
  • Access:
  • Read-only

Description

Gets or sets an optional description for the Business Rule.

  • Type:
  • String
  • Access:
  • Read/Write

ObjectType

Gets or sets the type of directory objects to which the Business Rule is applied. The property must be set to a string that contains the name of an object class as defined in the Active Directory schema (e.g. “user”, “group”, “computer”, “organizationalUnit”, etc.).

  • Type:
  • String
  • Access:
  • Read/Write

Remarks

To specify an additional object type, use IAdmBusinessRule2::AdditionalObjectType.


OperationType

Gets or sets the type of the operation that will trigger the Business Rule. List of possible values.

  • Type:
  • String
  • Access:
  • Read/Write

ExecutionMoment

Gets or sets a value that indicates when the Business Rule is to be executed. A Business Rule can be executed before or after the triggering operation.


ConditionedActions

Gets conditions and actions defined for the Business Rule. Each item in the collection is a set of actions and conditions. A set of actions and conditions is represented by the IAdmBusinessRuleConditionedActions interface.


ActivityScopeItems

Gets a collection of scope items that represent the activity scope of the Business Rule. A scope item is represented by the IAdmActivityScopeItem interface.


Disabled

Gets or sets a value that indicates whether the Business Rule is disabled.

  • Type:
  • Boolean
  • Access:
  • Read/Write

Requirements

Minimum required version: 2009.1

See also