This cmdlet creates an event monitor object to which you can subscribed by using the Register-ObjectEvent cmdlet.

You can use this cmdlet to monitor specific Lenovo XClarity Administrator events and trigger a defined script to handle the incoming event. It reconnect to XClarity Administrator when the network is not available or the management server is rebooted, and to continue monitoring events

Note: You cannot pipe objects to this cmdlet.


Start-LXCAEventMonitor [-Connection LXCAConnection] 
                       [-EventID String[]]
                       [-SourceID String[]] 
                       [-Severity EventSeverity[]] 
                       [-EventClass EventClass[]] 
                       [-MessageRegex String]


-Connection LXCAConnection
Specifies the connection to the Lenovo XClarity Administrator server. If no connection is specified, the result from the last Connect-LXCA cmdlet is used.
-EventID String[]
Specifies the event IDs to be monitored.
-SourceID String[]
Specifies the UUID of the component that is the event source (raiser or owner).
-Severity EventSeverity[]
Specifies the severity of the event to be monitored. You can specify one or more of the following severities, separated by a comma.
  • Unknown
  • Informational
  • Warning
  • Minor
  • Major
  • Critical
  • Fatal
Note: The severities that are listed through this cmdlet differ from those listed in the Lenovo XClarity Administrator web interface.
Lenovo XClarity Administrator web interface severity Severity parameter
Critical Fatal, Critical, Major
Warning Minor, Warning
Informational Informational
Unknown Unknown
-EventClass EventClass[]
Specifies the event source type. You can specify one or more of the following types, separated by a comma.
  • ADAPTOR (adapter card)
  • BLADE (Flex System server)
  • DISKS (storage)
  • EXPANSION (expansion card)
  • IOMODULE (Flex System switch)
  • SWITCH (RackSwitch switch)
  • SYSTEM (rack or tower server)
  • TEST
-MessageRegex String
Specifies the event message regex expression.
This cmdlet supports the following common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer, -PipelineVariable, -OutVariable. For detailed information about each common parameter, see the Microsoft PowerShell Common Parameters webpage.


This cmdlet returns an LXCAEventMonitor object.


The following example creates an event monitor and the uses Register-ObjectEvent to print out the event ID and message when a monitored event is received.

Note: In the Register-ObjectEvent cmdlet:
  • -EventName must be LXCAEvent.
  • -SourceIdentifier must be a unique string.
  • -Action is the script that handles the incoming event.

In the script, $EventArgs.Events is for all incoming events at this moment. Each event has the same properties as the event returned by Get-LXCAEvent cmdlet.

To stop the event monitoring, invoke $monitor.StopMonitor().

$cred = Get-Credential
Connect-LXCA -Host -Port 443 -Credential $cred

$monitor = Start-LXCAEventMonitor -EventClass Audit,Power -Severity Critical,Fatal
Register-ObjectEvent -InputObject $monitor -EventName LXCAEvent -SourceIdentifier MonitorAUDITPOWER`
                     -Action { Write-Host $EventArgs.Events[0].EventID -ForegroundColor Blue`
                      Write-Host $EventArgs.Events[0].Message -ForegroundColor Blue }
... ...