Capture script output in workflow

Is it possible to capture the output of a script executed in a workflow so it's included in the run history?

It would be great if we could see summary such as "Updated X objects" in the workflow run history.

Parents
  • I'm not aware of a way to populate the run history per se but would offer the following options:

    1) Include in a script activity run by your workflow a informational message written to the Admin Service windows event log.  Something like this:

    $Request.ReportEvent($Constants.EDS_EVENTLOG_INFORMATION_TYPE, ("Workflow ABC updated X objects.")

    2) I typically add information to the change history of objects processed.  An example of how to do this is below:

    # Update a user description and add a note about it in the "reason" field of the object's change history

    Set-QADUser -identity $Request.DN -Description "A new description" -Control @{'OperationReason'="Updated by Workflow ABC"}

    2a) In their properties, the Various built-in workflow Activities (for example Update Properties) also have an option to include the above control and message

    Hope this is helpful.

Reply
  • I'm not aware of a way to populate the run history per se but would offer the following options:

    1) Include in a script activity run by your workflow a informational message written to the Admin Service windows event log.  Something like this:

    $Request.ReportEvent($Constants.EDS_EVENTLOG_INFORMATION_TYPE, ("Workflow ABC updated X objects.")

    2) I typically add information to the change history of objects processed.  An example of how to do this is below:

    # Update a user description and add a note about it in the "reason" field of the object's change history

    Set-QADUser -identity $Request.DN -Description "A new description" -Control @{'OperationReason'="Updated by Workflow ABC"}

    2a) In their properties, the Various built-in workflow Activities (for example Update Properties) also have an option to include the above control and message

    Hope this is helpful.

Children
No Data