Sorry, search feature is not supported in Internet Explorer 11

IAdmRuleBasedGroupQueries

The IAdmRuleBasedGroupQueries interface is used to perform queries related to rule-based groups.

Inheritance: IUnknown

Methods

Details

GetRuleBasedGroups()

Returns GUIDs of all rule-based groups.

Guid[] GetRuleBasedGroups()

Examples

The following code sample outputs distinguished names (DNs) of all rule-based groups.

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

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

# Get GUIDs of all rule-based groups
$queries = $admService.GetRemoteObject("ADM_SERVICEOBJECTID_RULEBASEDGROUPQUERIES")
$ruleBasedGroupGuids = $queries.GetRuleBasedGroups()

# Output distinguished names of the groups
foreach ($ruleBasedGroupGuid in $ruleBasedGroupGuids)
{
    # Get distinguished name of the group
    $ruleBasedGroup = $admService.OpenObject("Adaxes://<GUID=$ruleBasedGroupGuid>", $NULL, $NULL, 0)
    $ruleBasedGroupDN = $ruleBasedGroup.Get("distinguishedName")
    
    Write-Host $ruleBasedGroupDN
}
C#
using System;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;
class Program
{
    static void Main(string[] args)
    {
        // Connect to the Adaxes service
        var adsNS = new AdmNamespace();
        IAdmService admService = adsNS.GetServiceDirectly("localhost");

        // Get GUIDs of all rule-based groups
        IAdmServiceObjectProvider admServiceObjectProvider = (IAdmServiceObjectProvider)admService;
        IAdmRuleBasedGroupQueries queries = 
            (IAdmRuleBasedGroupQueries)admServiceObjectProvider.GetRemoteObject(
                ADM_SERVICEOBJECTID_ENUM.ADM_SERVICEOBJECTID_RULEBASEDGROUPQUERIES);
        Guid[] ruleBasedGroupGuids = queries.GetRuleBasedGroups();

        // Output distinguished names of the groups
        foreach (Guid ruleBasedGroupGuid in ruleBasedGroupGuids)
        {
            // Get distinguished name of the group
            string ruleBasedGroupPath = string.Format("Adaxes://<GUID={0}>", ruleBasedGroupGuid);
            IADsGroup ruleBasedGroup = (IADsGroup)admService.OpenObject(ruleBasedGroupPath, null, null, 0);
            string ruleBasedGroupDN = (string)ruleBasedGroup.Get("distinguishedName");

            Console.WriteLine(ruleBasedGroupDN);
        }        
    }
}

Requirements

Minimum required version: 2020.1

See also