PowerShell function testing if a SCOM ETL trace is running

The other day I needed a function which tells me if a SCOM ETL trace is currently running or not. I had some hard time to figure out a simple and reliable way testing this. With some great assistance from my Support colleagues Silvana Deac and Mihai Sarbulescu I finally found a way :)

The attached function test-customopsmgrtracerunning

  • does not require any parameter
  • returns $NULL if it cannot determine the Tools directory on an Agent or Management Server
  • returns $True if it finds loaded OpsMgrTrace ETL files -> Trace is running
  • returns $False if it does not find loaded OpsMgrTrace ETL files -> Trace is not running

The function in action:

test-customopsmgrtracerunning.ps1