Skip to main content

Powershell Runbook

A Powershell runbook runs a PowerShell script on a Windows host over WinRM and parses the output back into values on the result screen.

When to Use​

Use Powershell for anything that needs the Windows management stack: services, event logs, performance counters, WMI, registry, disk health, scheduled tasks, Active Directory cmdlets.

Fields​

FieldWhat to enter
Runbook NameA short, unique name.
DescriptionOne line on what the runbook returns.
Runbook CategoryDiagnostics, Performance Monitoring, Troubleshooting, System Management, Log Collection, Network Config, or Integration.
MonitorPick by Group, Tag, IP/Host, or Monitors.
Credential ProfileThe WinRM credential. Click Create Credential Profile if none fits.
PortWinRM port. Defaults to the credential profile's port (5985 for HTTP, 5986 for HTTPS).
TimeoutSeconds to wait before marking the run Failed.
Powershell ScriptThe PowerShell command or script the agent runs over WinRM.
Script LanguageGO or Python, for the parsing script.
Parsing ScriptTurns the raw PowerShell output into the result values.
Add VariablePrompts the user for a value at run time. Reference it as $$$variable.name$$$ in both scripts.

The right-side Sample Parsing Script > Powershell Availability panel shows a working parser you can copy and adjust.

Steps​

  1. Open Settings > Plugin Library > Runbook and click Create Runbook Plugin.
  2. Pick Powershell from the top menu.
  3. Fill in the fields above.
  4. Click Test to run the Powershell script against the chosen monitor and show the parsed values.
  5. Click Save.
note

The Windows credential must have the permissions the script requires. For service start or stop, that is Service Control permission. For event log reads, that is Event Log Reader permission.