Skip to content

IAdmConfigurationQueries

The IAdmConfigurationQueries interface provides access to information about Adaxes configuration objects.

Inheritance: The IAdmConfigurationQueries interface inherits from the IUnknown interface.

Methods

Details

GetCustomCommandsInfo()

Returns an array of interfaces, each describing a Custom Command defined within the Adaxes service.

IAdmCustomCommandInfo[] GetCustomCommandsInfo(Boolean onlyEnabledCommands)

Parameters

The onlyEnabledCommands parameter specifies whether only enabled Custom Commands must be returned.

Examples

The following code sample outputs name and ID of each Custom Command defined within Adaxes service.

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

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

# Get information about Custom Commands
$configurationQueries = $admService.GetConfigurationQueries()
$customCommandsInfo = $configurationQueries.GetCustomCommandsInfo($False)

foreach ($info in $customCommandsInfo)
{
    Write-Host "Name:" $info.Name
    Write-Host "ID:" $info.ID
    Write-Host
}
using System;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi.CustomCommands;
using Softerra.Adaxes.Interop.Adsi.Management;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;

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

        // Get information about Custom Commands
        IAdmConfigurationQueries configurationQueries = admService.GetConfigurationQueries();
        IAdmCustomCommandInfo[] customCommandsInfo =
            (IAdmCustomCommandInfo[])configurationQueries.GetCustomCommandsInfo(false);

        foreach (IAdmCustomCommandInfo info in customCommandsInfo)
        {
            Console.WriteLine("Name: " + info.Name);
            Console.WriteLine("ID: " + info.Id);
            Console.WriteLine();
        }
    }
}

GetEffectivePropertyPatterns()

Returns an array of interfaces describing Property Patterns effective for the specified directory object.

IAdmPropertyPatternInfo[] GetEffectivePropertyPatterns(IAdmTop targetObject)

Examples

The following code sample outputs name, description and status of all Property Patterns affecting the given user account.

[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)

# Get information about the effective Property Patterns
$configurationQueries = $admService.GetConfigurationQueries()
$effectivePropertyPatterns = $configurationQueries.GetEffectivePropertyPatterns($user)

Write-Host "Property Patterns effective for the user:"
foreach ($propertyPatternInfo in $effectivePropertyPatterns)
{
    Write-Host "`tName:" $propertyPatternInfo.FullName
    Write-Host "`tDescription:" $propertyPatternInfo.Description
    Write-Host "`tDisabled:" $propertyPatternInfo.Disabled
    Write-Host
}
using System;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi;
using Softerra.Adaxes.Interop.Adsi.Management;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;
using Softerra.Adaxes.Interop.Adsi.PropertyPatterns;

class Program
{
    static void Main(string[] args)
    {
        // Connect to the Adaxes service
        AdmNamespace adsNS = new AdmNamespace();
        IAdmService2 admService = (IAdmService2)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);

        // Get information about the effective Property Patterns
        IAdmConfigurationQueries configurationQueries = admService.GetConfigurationQueries();
        IAdmPropertyPatternInfo[] effectivePropertyPatterns =
            (IAdmPropertyPatternInfo[])configurationQueries.GetEffectivePropertyPatterns(user);

        Console.WriteLine("Property Patterns effective for the user:");
        foreach (IAdmPropertyPatternInfo propertyPatternInfo in effectivePropertyPatterns)
        {
            Console.WriteLine("\tName: " + propertyPatternInfo.FullName);
            Console.WriteLine("\tDescription: " + propertyPatternInfo.Description);
            Console.WriteLine("\tDisabled: " + propertyPatternInfo.Disabled);
            Console.WriteLine();
        }
    }
}

GetEffectivePropertyPatternsEx()

Returns an array of interfaces describing Property Patterns effective for the specified directory objects.

IAdmPropertyPatternInfo[] GetEffectivePropertyPatternsEx(String[] targetObjectPaths)

Parameters

The targetObjectPaths parameter specifies an array of ADS paths to the directory objects to retrieve Property Patterns for.

Examples

The following code sample outputs name, description and status of all Property Patterns affecting multiple user accounts.

$user1Path = "Adaxes://CN=John Smith,CN=Users,DC=company,DC=com"
$user2Path = "Adaxes://CN=Bob Jones,CN=Users,DC=company,DC=com"

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

# Get information about the effective Property Patterns
$configurationQueries = $admService.GetConfigurationQueries()
$effectivePropertyPatterns = $configurationQueries.GetEffectivePropertyPatternsEx(@($user1Path, $user2Path))

Write-Host "Property Patterns effective for the users:"
foreach ($propertyPatternInfo in $effectivePropertyPatterns)
{
    Write-Host "`tName:" $propertyPatternInfo.FullName
    Write-Host "`tDescription:" $propertyPatternInfo.Description
    Write-Host "`tDisabled:" $propertyPatternInfo.Disabled
    Write-Host
}
using System;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi.Management;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;
using Softerra.Adaxes.Interop.Adsi.PropertyPatterns;

class Program
{
    static void Main(string[] args)
    {
        const String fisrtPath = "Adaxes://CN=John Smith,CN=Users,DC=company,DC=com";
        const String secondPath = "Adaxes://CN=Bob Jones,CN=Users,DC=company,DC=com";

        // Connect to the Adaxes service
        AdmNamespace adsNS = new AdmNamespace();
        IAdmService2 admService = (IAdmService2)adsNS.GetServiceDirectly("localhost");

        // Get information about the effective Property Patterns
        IAdmConfigurationQueries configurationQueries = admService.GetConfigurationQueries();
        IAdmPropertyPatternInfo[] effectivePropertyPatterns =
            (IAdmPropertyPatternInfo[])configurationQueries.GetEffectivePropertyPatternsEx(
                new String[] { fisrtPath, secondPath });

        Console.WriteLine("Property Patterns effective for the users:");
        foreach (IAdmPropertyPatternInfo propertyPatternInfo in effectivePropertyPatterns)
        {
            Console.WriteLine("\tName: " + propertyPatternInfo.FullName);
            Console.WriteLine("\tDecription: " + propertyPatternInfo.Description);
            Console.WriteLine("\tDisabled: " + propertyPatternInfo.Disabled);
            Console.WriteLine();
        }
    }
}

Requirements

Minimum required version: 2011.1

See also