Table of Contents
- Getting Started
- Agent-Based Management
- Common Tasks
- Data Providers
- Directory Services
- Auditing
- Hosts
- Templates
- Template Properties
- Batch Update Templates
- Assign Templates
- Log Management Templates
- SCAP Compliance Monitor
- Active Directory User Monitor Templates
- File and Directory Monitor Templates
- Windows Monitor Templates
- CPU Monitor Template
- Memory Monitor Template
- Disk Space Monitor Template
- Account Lockout Monitor Template
- Audit Policy Monitor Template
- Logon As Monitor Template
- Logon Monitor Template
- Performance Counter Monitor Template
- PowerShell Template
- Process Monitor Template
- RDP Session Monitor Template
- Registry Value Monitor Template
- Service Monitor Template
- SMART Disk Monitor Template
- System Security Monitor Template
- Windows Update Template
- WMI Query Template
- Task Scheduler Template
- Clock Synchronization Template
- Defragment NTFS Disks Template
- Network and Application Monitor Templates
- SSL Certificate Monitor Templates
- Database Templates
- Email Monitor Templates
- SNMP Monitor Templates
- Windows Accounts Templates
- Monitors
- Reports
- Auto-Configurators
- Filters
- Actions
- Schedules
- Environment Variables
- Options
- SNMP
- SSH Shell
- Syslog
- System Reset
- Shared Views
- Active Directory User and Group Filters
- Assign Actions
- Assign Azure Audit Logs
- Assign Consolidated Logs
- Assign Directories
- Assign Disks
- Assign Event Logs
- Assign Files
- Assign Services
- Assign Shares
- Auto-Config Host Assignment Properties
- Define CSV and W3C Log Entry Columns
- Define Log Entry Columns
- Define Log Entry Columns with Regular Expressions
- Executable Status
- Executable Timeline
- Explicitly Assigned Logs
- File Explorer
- General Executable Properties
- Report Columns
- Report Date/Time Ranges
- Report Security Event Log Filters
- Select Folder or File
- Target Files and Sub-Directories
- Command Line Interface
- Server Configuration
- Agent Configuration
- Troubleshooting
- Terminology
Corner Bowl Server Manager
SIEM, IPS, Server Monitoring, Uptime Monitoring and Compliance Software
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.
In this Topic
- How To Create a PowerShell Template
- How To Create a PowerShell Command Template
- How To Create a PowerShell Script Template
- How To Set the PowerShell Timeout
- How To Monitor and Report on PowerShell Results
- Testing the PowerShell Template
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.
- General
- Options
- Agent Template
- Actions
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}
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
button to view the PowerShell command results.
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
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.
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.
- Use the Warning trigger and the Critical trigger controls to apply trigger criteria to each returned row.
- 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
button to auto-generate a name based on the configured settings.