IAdmScheduledReportItem
The IAdmScheduledReportItem interface represents an item of a scheduled task used to generate and deliver reports.
Inheritance: IAdmTop
Methods
-
Method
-
Description
-
IsRecipient()
-
Validates whether the given user is a recipient of the scheduled report.
-
CreateRecipientSearcher()
-
Returns the IAdmDirectorySearcher interface that can be used to find all users that are recipients of the scheduled report.
Properties
-
Property
-
Description
-
ReportData
-
Gets or sets parameters used to schedule generation and delivery of a report.
-
ActivityScopeItems
-
Gets recipients of the scheduled report.
Details
IsRecipient()
Validates whether the given user is a recipient of the scheduled report.
bool IsRecipient(IAdmTop user)
CreateRecipientSearcher()
Returns the IAdmDirectorySearcher 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.
- PowerShell
-
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi") # Connect to the Adaxes service $ns = New-Object "Softerra.Adaxes.Adsi.AdmNamespace" $service = $ns.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 = $service.OpenObject("Adaxes://$reportScheduledTaskDN", $null, $null, 0) foreach ($scheduledReportItem in $reportScheduledTask.ScheduledReports) { try { # Retrieve the IAdmDirectorySearcher 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() } }
- C#
-
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 ns = new AdmNamespace(); IAdmService service = ns.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)service.OpenObject("Adaxes://" + reportScheduledTaskDN, null, null, 0); foreach (IAdmScheduledReportItem scheduledReportItem in reportScheduledTask.ScheduledReports) { // Retrieve the IAdmDirectorySearcher 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.
- Type:
- IAdmScheduledReportData
- Access:
- Read/Write
ActivityScopeItems
Gets recipients of the scheduled report. Each recipient in the collection is represented by the IAdmActivityScopeItem interface.
- Type:
- IAdmCollection
- Access:
- Read-only
Requirements
Minimum required version: 2018.1