Documentation forServer & Application Monitor
Monitoring your applications and environment is a key capability of Hybrid Cloud Observability and is also available in a standalone module, Server & Application Monitor (SAM). Hybrid Cloud Observability and SAM are built on the self-hosted SolarWinds Platform.

PowerShell Templates and Monitors

Many SAM templates contain component monitors that allow for the use of PowerShell scripts. An easy way to find these templates is to navigate to the Manage Application Monitor Templates page and search for the word, "PowerShell." This can be done in the SolarWinds Platform Web Console by navigating to Settings > SAM Settings > Manage Templates. The search text box is at the top-right of the screen.

Below is a sample list of the templates found when "PowerShell" is searched. To examine a template, check the box next to the template name. After you select a template, the Edit button is enabled. Click Edit at the top of the list to open the selected template.

In this example, the Exchange 2016 Mailbox Send and Receive Statistics with PowerShell template is used. This template tracks Exchange Mailbox Send/Receive statistics for Exchange 2016 servers with the Mailbox role using PowerShell scripts.

The following screen appears after you select a template to edit, revealing the individual component monitors as well as details about the template:

The following documentation accompanies this template:

Prerequisites:

  • PowerShell 5.1 and Exchange Management Tools 2007 or 2010 are installed on the target server.
  • The Exchange server must have an Exchange Mailbox role.
  • The SolarWinds Platform server and the Exchange server must be in the same domain.

Credentials:

The credentials must be an Exchange Administrator (Organization Manager) account with at least view-only permissions.

Before using this template, under the Advanced tree collapse [+], you should set the correct platform; either 32-bit or 64-bit, from the drop-down menu. The default it set to 32-bit.

For all PowerShell component monitors: Specify the correct name of your Exchange user and server in the Script Arguments field of the corresponding PowerShell Monitor. Otherwise, the counter will return an Undefined status.

For example: If the name of your Exchange server is exchange.mydomain.com, and the user you want to monitor is some.user@domain.sw, the value in the Script Arguments field should be the following: some.user@domain.sw,exchange.mydomain.com.

To see the names of your Exchange servers, run the following PowerShell command in the Exchange Management Shell: Get-ExchangeServer

To see the names of the users, run the following PowerShell command in Exchange Management Shell: Get-Mailbox

To examine and edit an individual PowerShell component monitor within the template, click [+] to the left of the monitor. For example: Number of items received by specific user during last month.

The following details about the selected component monitor are revealed:

Using a PowerShell script, the monitor in this example is designed to return the number of items received by a specific user during the last month.

To use this monitor, change the Script Arguments field from the default example of, user@domain.sw,server.domain.sw to something that suits your needs for your particular environment. You can do this by clicking the Edit button (highlighted above). You also can alter the predefined script that comes with PowerShell component monitors.

Unless otherwise directed by the documentation, you should not need to edit predefined scripts.

After you edit the Script Arguments field, click Submit to begin using the component monitor within the template. The output for this script using the SAM monitor, Number of items received by specific user during last month, should be similar to the following illustration:

The output for the script using only PowerShell should be similar to the following illustration: