Skip to content
English
  • There are no suggestions because the search field is empty.

Get a monitor's health state with PowerShell

Use the SCOM PowerShell cmdlets to read the health state of a VMware monitor for a specific virtual machine.

Applies to: OpsLogix VMware Management Pack (all versions) · SCOM 2019, 2022, 2025
Last updated: October 2026 · Reading time: 1 minute

Goal

Get the health state of a VMware monitor for a virtual machine with PowerShell, for example to use in your own scripts or reports. This example reads the Virtual Machine VMware Tools Status monitor.

Prerequisites

  • The SCOM Operations Manager PowerShell module, for example on a SCOM management server.
  • The name of the virtual machine as it's shown in SCOM.

Steps

Replace <Virtual Machine Name> with the name of your VM and run:

$vmClass = Get-SCOMClass -Name "OpsLogix.IMP.VMWare.VirtualMachine"
$class = Get-SCOMClassInstance -Class $vmClass | Where-Object { $_.DisplayName -eq "<Virtual Machine Name>" } | Select-Object -First 1
$monitor = Get-SCOMMonitor -Name "OpsLogix.IMP.VMWare.Monitoring.VM.ToolsStatus"
$monitorInstances = New-Object "System.Collections.Generic.List[Microsoft.EnterpriseManagement.Configuration.ManagementPackMonitor]"
$monitorInstances.add($monitor)
$state= $class.getmonitoringstates($monitorInstances)

The script looks up the VM by its display name within the VMware Virtual Machine class, so it doesn't pick up a Windows computer with the same name. If several VMs have the same name, it uses the first one. To check a different monitor, change the monitor name in the third line. To find the name (ID) of a monitor, run Get-SCOMMonitor -DisplayName "<display name>" | Select-Object Name.

Verify it worked

Run $state to show the result. The HealthState property shows the current state of the monitor for that VM.

See also