Versions Compared

Key

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

...

  • Line 1: The job is executed with a Windows Agent and makes use of the PowerShell shebang for Windows, see above explanation.
  • Line 3-4: The required PowerShell modules are imported. They could be installed with any location in the file system
  • Line 6-7: The Connect-JS7 cmdlet is used to authenticate with the JS7 REST Web Service API. The required arguments for -Url , -Credentials and -Id can specified in a number of ways:
  • Line 10: For better readability of the report the start types of jobs are mapped to a textual representation (single start, cyclic start etc.).Line 13: The Get-JS7DailyPlanOrderJS7AuditLog cmdlet is invoked
    • with the parameter -Timezone to specify to which time zone date values in the report should be converted. The parameter value -Timezone (Get-Timezone) specifies that the time zone of the Agent's server is used. Otherwise specify the desired time zone, for example like this: -Timezone (Get-Timezone -Id 'GMT Standard Time'). Without using this parameter any date values are stored as UTC dates to the report.
    • optionally with additional parameters, for example to specify the date or date range for which the report is created  A value -RelativeDateTo +7d specifies that the report should cover the next 7 days (until midnight). Keep in mind that dates have to be specified for the UTC time zone. Without this parameter the report will be created for the next day.
    • see the Get-JS7DailyPlanOrderJS7AuditLog cmdlet for a full parameter reference.
  • Line 1411-2617: From the output of the Get-JS7DailyPlanOrderJS7AuditLog cmdlet a number of properties are selected and and are specified for the sequence in which they should occur in the report. 
    • To add more speaking column headers the property names are mapped to a more readable textual representation.
    • Consider the handling of date formats in line 21, 22 and 24, 25. 17 Use of the Get-Date cmdlet converts the output format of dates (not the time zone) to the default format that is in place on the Agent's server. Without using the Get-Date cmdlet any date values will be stored to the report in ISO format, e.g. 2020-12-31 10:11:12+02:00 for a date in the European central time zone that is UTC+1 in winter time and UTC+2 in summer time.Lines 23, 26 introduce a new property, a calculated duration. From the start time and end time values of a planned start and optionally of a past start the difference in seconds is calculated and is forwarded to the report.
  • Line 2718: The list of properties per Daily Plan Audit Log item is piped to the Export-Excel cmdlet that is available with the ImportExcel PowerShell Module. The report file name is specified and optionally the worksheet. For a full list of parameters see the ImportExcel PowerShell Module.

Further Resources

  • The Audit Log Report does not include information about login/logout of user accounts. In some countries such information is subject to data protection laws. Therefore this information is available exclusively with a log file that is accessible to system administrators and that can be used in compliance with applicable law.
  • Reporting by nature is about the past. Users who look for in-real time information can consider to directly report Audit Log output to a syslog server.