Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Find a sample report for download that includes the report with its Audit-Log worksheetjobscheduler_reporting.xlsx

...

Please consider that the below job is an example that has to be adjusted for your environment.

Download: jdDailyPlanReportjdAuditLogReport.workflow.json


Code Block
languagepowershell
titleDaily Plan Report Job
linenumberstrue
@@findstr/v "^@@f.*&" "%~f0"|pwsh.exe -&goto:eof

Import-Module ImportExcel
Import-Module JS7

$credentials = ( New-Object -typename System.Management.Automation.PSCredential -ArgumentList 'root', ( 'root' | ConvertTo-SecureString -AsPlainText -Force) )
Connect-JS7 -Url $env:JS7_JOC_URL -Credentials $credentials -Id $env:JS7_CONTROLLER_ID | Out-Null

# Dates in local time zone, output includes local date format
Get-JS7AuditLog -Timezone (Get-Timezone) `
                |  Select-Object -Property @{name="Account"; expression={$_.account}}, `
                                           @{name="Category"; expression={$_.category}}, `
                                           @{name="Controller ID"; expression={$_.controllerId}}, `
                                           @{name="ID"; expression={$_.id}}, `
                                           @{name="Parameters"; expression={$_.parameters}}, `
                                           @{name="Request"; expression={$_.request}}, `
                                           @{name="Created"; expression={(Get-Date $_.created)}} `
                | Export-Excel -Path /tmp/jobscheduler_reporting.xlsx -WorksheetName "Audit-Log" -ClearSheet
							
Write-Output ".. report created: /tmp/jobscheduler_reporting.xlsx"

...