Thanks.
I was now able to generate a report directly in Adaxes Console.
Is there a way to export this data with Execution log?
Or is there a way to get the execution log for each record via PowerShell only (not PowerShell to be used in Report script area)?
PowerShell native I was able to export only errors to a CSV file - but execution log is missing
[Reflection.Assembly]::LoadWithPartialName("Softerra.Adaxes.Adsi")
$numDays = 1 # set to 0 to output all records
$ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$service = $ns.GetServiceDirectly("localhost")
# Bind to the directory object representing the General Log
$path = $service.Backend.GetConfigurationContainerPath("ServiceLog")
$serviceLog = $service.OpenObject($path.ToString(), $null, $null, 0)
$generalLog = $serviceLog.GeneralLog
if ($numDays -ne 0) {
$generalLog.StartDateTime = (Get-Date).AddDays(-$numDays)
$generalLog.EndDateTime = Get-Date
}
# Get the log records
$log = $generalLog.Log
$records = $log.GetPage(0)
[System.Collections.ArrayList]$output = @()
# Output the log records
foreach ($record in $records) {
if (($record.State -ieq "OPERATION_STATE_COMPLETED")) {
continue;
}
if (($record.Initiator.Name -ieq "XYZ")) {
continue;
}
# Not working
#$exlog = GetExecutionLog($record)
$output += $record
}
$file_data = "State;StartTime;CompletionTime;Initiator.Name;TargetObjectName;TargetObjectType;Description`r`n"
$output | % { $file_data += "$($_.State);$($_.StartTime);$($_.CompletionTime);$($_.Initiator.Name);$($_.TargetObjectName);$($_.TargetObjectType);$($_.Description);`r`n"}
$file_data | Out-File "c:\temp\adaxes_only-error.csv"