Adding and editing a PowerShell action

Windows PowerShell is a scripting language and command-line shell that system administrators can use to manage Windows operating systems. For more information on PowerShell, please visit the Microsoft web site.

The PowerShell action delivers a robust and flexible environment to the experienced user for developing custom actions through direct access to script component libraries, including the .NET Framework. For more information, see PowerShell action script examples.

Important: WhatsUp Gold uses a 32-bit (i.e. x86) PowerShell engine. Therefore, only 32-bit PowerShell snap-ins are supported and 64-bit only snap-ins will not function properly. Snap-ins usable in both 32-bit and 64-bit operating systems are configured for 64-bit systems by default and must be manually configured for 32-bit PowerShell engine to function properly with WhatsUp Gold.

If you are using additional pollers with WhatsUp Gold, PowerShell must be installed and any desired snap-ins must be registered identically on all poller machines for any PowerShell performance monitors, active monitors, and actions to function properly. Associated errors resulting from failed monitors will appear in the WhatsUp Gold Status Center. Errors resulting from failed actions will appear in the WhatsUp Gold Event Viewer.

To add a new PowerShell action:

  1. From the WhatsUp Gold web interface, go to Admin > Actions. The Action Library appears.
  2. Click New. The Select Action Type dialog appears.
  3. Select PowerShell, then click OK. The New PowerShell Script Action dialog appears.
  4. Enter or select the appropriate information:
    • Name. Enter a unique name for the action. This name displays in the Action Library.
    • Description. (Optional) Enter additional information about the action. This description displays next to the action in the Action Library.
    • Timeout (seconds). Enter the length of time WhatsUp Gold attempts to connect to the selected device. When the time you enter is exceeded without connecting, a timeout occurs and WhatsUp Gold stops trying to connect to the device. This is considered a failed connection.

    Note: You are highly discouraged from using a timeout longer than 10 seconds. Please use the shortest timeout possible.

    • Run under device credentials. Select this check box to execute the script using the Windows credentials for the affected device. For additional information, see Using the Credentials Library.
    • Script Text. Enter your action code.

      Important: When using percent variables as part of string literals in your PowerShell scripts, please use double quotation marks (" ") instead of single quotation marks (' ') to enclose the string literal. For example: $Message = "%Device.DisplayName changed state".

  5. Click OK to save changes.
  6. Click OK to exit the Action Library.

To edit an existing PowerShell action:

  1. From the WhatsUp Gold web interface, go to Admin > Actions. The Action Library dialog appears.
  2. Select the action you would like to edit, then click Edit. The Edit PowerShell Script Action dialog appears.
  3. Enter or select the appropriate information:
    • Name. Enter a unique name for the action. This name displays in the Action Library.
    • Description. (Optional) Enter additional information about the action. This description displays next to the action in the Action Library.
    • Enter the length of time WhatsUp Gold attempts to connect to the selected device. When the time you enter is exceeded without connecting, a timeout occurs and WhatsUp Gold stops trying to connect to the SMTP server. This is considered a failed connection.

    Note: You are highly discouraged from using a timeout longer than 10 seconds. Please use the shortest timeout possible.

    • Run under device credentials. Select this check box to execute the script using the Windows credentials for the affected device. For additional information, see Using the Credentials Library.
    • Script Text. Enter your action code.
  4. Click OK to save changes.
  5. Click OK to exit the Action Library.

See Also

Functional actions

Adding and editing an Active Script Action

Adding and editing a Log to Text File Action

Adding and editing a Program Action

Adding and editing a Service Restart Action

Adding and editing a SNMP Set Action

Adding and editing a SSH Action

Adding and editing a Syslog Action

Adding and Editing a VMware Action

Adding and Editing a Windows Event Log Action

Using the WinPopup Action