Skip to content

How to create reports with ScriptRunner

Heiko Brenn edited this page Oct 30, 2019 · 25 revisions

Generate reports with the ReportHtml module from Matthew Quickenden and ScriptRunner

Step-by-Step Guide

Install PowerShell module "ReportHtml"

Install "ReportHtml" on the ScriptRunner server

Install-module reporthtml

Make sure "Remote Access Management Tools" are installed

Get-WindowsFeature -name rsat-remoteaccess* |Install-WindowsFeature

Create a folder for the reports

New-Item -Path "C:\programdata\ScriptRunner" -Name "Reports" -ItemType "directory"

Create a new virtual directory in IIS

New-WebVirtualDirectory -Site "Default Web Site\scriptrunner" -Name reports -PhysicalPath c:\programdata\scriptrunner\reports

Copy New-ADReport.ps1 to your ScriptMgr folder

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Invoke-WebRequest -Uri https://raw.githubusercontent.com/HeikoBrenn/ScriptRunner/master/scripts/New-ADReport.ps1 -OutFile C:\programdata\scriptrunner\scriptmgr\test\New-ADReport.ps1

The script can be found at: https://github.com/HeikoBrenn/ScriptRunner/blob/master/scripts/New-ADReport.ps1

Create a ScriptRunner Action

Modify $ReportSavePath and $ReportBaseUri according to your infrastructure

Run the ScriptRunner Action in the DelegateApp

The URL of the new report will be displayed as the result message