Skip to content

IAdmScheduledReportItem

The IAdmScheduledReportItem interface represents an item of a Scheduled Task used to generate and deliver reports.

Inheritance: The IAdmScheduledReportItem interface inherits from the IAdmTop interface.

Methods

Properties

Details

IsRecipient()

Validates whether the given user is a recipient of the scheduled report.

Boolean IsRecipient(IAdmTop user)

CreateRecipientSearcher()

Returns the IAdmDirectorySearch interface that can be used to find all users that are recipients of the scheduled report.

Object CreateRecipientSearcher()

Examples

The following code sample outputs recipients of all reports scheduled by a task.

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

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

# Bind to a report scheduled task
$reportScheduledTaskDN = "CN=MyTask,CN=Report Schedule,CN=Reports Root,CN=Configuration Objects,"+
    "CN=Adaxes Configuration,CN=Adaxes"
$reportScheduledTask = $admService.OpenObject("Adaxes://$reportScheduledTaskDN", $NULL, $NULL, 0)

foreach ($scheduledReportItem in $reportScheduledTask.ScheduledReports)
{
    try
    {
        # Retrieve the IAdmDirectorySearch interface
        $recipientsSeacher = $scheduledReportItem.CreateRecipientSearcher()

        # Execute search
        $searchResultIterator = $recipientsSeacher.ExecuteSearch()
        $searchResults = $searchResultIterator.FetchAll()

        # Output reports and their recipients
        Write-Host "Report: "$scheduledReportItem.ReportData.Report.ReportName
        Write-Host "Recipients:"

        foreach ($searchResult in $searchResults)
        {
            Write-Host $searchResult.Name            
        }
        Write-Host
    }
    finally
    {
        # Release resources
        $searchResultIterator.Dispose()
    }
}
using System;
using Softerra.Adaxes.Adsi;
using Softerra.Adaxes.Interop.Adsi.PersistentObjects;
using Softerra.Adaxes.Interop.Adsi.Reports.Schedule;

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

        // Bind to a report scheduled task
        const String reportScheduledTaskDN =
            "CN=MyTask,CN=Report Schedule,CN=Reports Root,CN=Configuration Objects," +
            "CN=Adaxes Configuration,CN=Adaxes";
        IAdmReportScheduledTask reportScheduledTask = 
            (IAdmReportScheduledTask)admService.OpenObject("Adaxes://" + reportScheduledTaskDN, 
            null, null, 0);

        foreach (IAdmScheduledReportItem scheduledReportItem in reportScheduledTask.ScheduledReports)
        {
            // Retrieve the IAdmDirectorySearch interface
            IAdmDirectorySearcher recipientsSeacher =
                (IAdmDirectorySearcher) scheduledReportItem.CreateRecipientSearcher();

            // Execute search
            using (IAdmSearchResultIterator searchResultIterator = recipientsSeacher.ExecuteSearch())
            {
                AdmSearchResult[] searchResults = searchResultIterator.FetchAll();

                // Output recipients
                Console.WriteLine("Report: " + scheduledReportItem.ReportData.Report.ReportName);
                Console.WriteLine("Recipients:");
                foreach (AdmSearchResult searchResult in searchResults)
                {
                    Console.WriteLine(searchResult.Name);
                }
                Console.WriteLine();
            }
        }
    }
}

ReportData

Gets or sets parameters used to schedule generation and delivery of a report.


ActivityScopeItems

Gets recipients of the scheduled report. Each recipient in the collection is represented by the IAdmActivityScopeItem interface.


Requirements

Minimum required version: 2018.1

See also