SIEM, Vulnerability Scanning, Server Monitoring and Compliance Training for IT Professionals
Table of Contents

PowerShell Template

The PowerShell Template enables you to execute PowerShell commands and scripts then optionally respond to results or generate a report. This template is typically used to execute custom functionality or query the operating system for information, for example, all local accounts that have not logged in within the last 90 days.

How to Get a List of Inactive Local Windows Accounts Tutorial on youtube

In this Topic

How To Create a PowerShell Template

  • From the Menu Bar, select File | New. The Create New Object View displays.
  • From the Create New Object View, expand Templates | Windows Monitors then select PowerShell Monitor. The New Template Properties View displays.
  • The Template Properties view contains 4 tabs.
Important
This Template requires the Agent be installed on all managed hosts excluding the localhost. For more information see: Agent-Based Management

The Options Tab

  • Use the Windows server or workstation drop-down to select any Windows host you would like to monitor.
Important
To configure PowerShell Templates on remotely managed systems, the Agent must be installed on the remote host and configured to remain connected. For more information see Host Agent Properties.
Note
Once selected, the host is automatically assigned to this template.
  • Use the Type drop-down to select to either run an individual Command or Script.

How To Create a PowerShell Command Template

  • From the Type drop-down, Command.
  • Use the Module drop-down to select from the list of available modules. Click the help button to view Microsoft's corresponding PowerShell documentation.
  • Use the Command drop-down to select from the list of available module commands. Click the help button to view Microsoft's corresponding PowerShell documentation.
  • Use the Parameters drop-down to set the command's parameter values.
Note
Use variable placeholders, keys wrapped with curly brackets {KEY}, to replace with extracted values.
For example: {c-ip} or {TARGET_ACCOUNT_NAME}
  • Use the Select textbox to specify the column values you want to view. If you are unsure, specify * to view all column values.
  • Use the Execute Execute PowerShell script button to view the PowerShell command results.
PowerShell Command Properties
PowerShell Command Properties

How To Create a PowerShell Script Template

  • From the Type drop-down, Script.
  • Use the Filename drop-down to select the local script to run.
Important
When managing a remote machine, the script is uploaded to the Agent, then, executed locally on the remote machine.
  • Use the Arguments text box to specify the PowerShell command-line parameters.
    For example: -ExecutionPolicy Unrestricted
PowerShell Script Properties
PowerShell Script Properties

How To Set the PowerShell Timeout

  • Use the Execution timeout controls to set the maximum time to wait for PowerShell to complete before triggering a timeout error.
Execution Timeout Controls
Execution Timeout Controls

How To Monitor and Report on PowerShell Results

  • Click the Load Columns button to run the command or script then automatically parse the results into data table columns.
PowerShell Result Column Properties
PowerShell Result Column Properties
  • Use the Warning trigger and the Critical trigger controls to apply trigger criteria to each returned row.
PowerShell Trigger Properties
PowerShell Trigger Properties
  • Use Save results to the database to save each returned row to the Log Repository for external consumption.
  • Use Hide informational results checkbox to remove all informational results from the result data table.
  • Use Hide triggered results checkbox to remove all trigger results from the result data table.

Testing the PowerShell Template

  • Click the Test button to verify the template is configured property and the monitor executes as expected.
  • Finally, select the General Tab, then click the click the Auto-Generate Name Auto-Generate Name Button button to auto-generate a name based on the configured settings.

Related Topics

General Tab

Actions Tab

Windows Monitor Templates