Using Coral8 and PowerShell to receive eventing data

I’ve updated the PowerShell Coral8 adapter so it can be used to receive input. Rather than demonstrate input from a database or an RSS stream, both of which can are supported by the native Coral8 adapters, I have a demo with WMI events. In this case allowing us to monitor process creation across a network.

Using the same general template as before we have the following two script blocks

BeginBlock

$computers = &{$args} localhost ccs01 ccs02
$jobs = $computers | % `
 {
   Register-WmiEvent -Class Win32_ProcessStartTrace -ComputerName $_ ` 
   -Action  { `
            $res = @{}
            $res['ProcessName'] = $args[1].NewEvent.ProcessName
            $res['ComputerName'] = $args[0].scope.Path.Server
            return $res
        }
    }

InputBlock

while ($true) 
{
    Start-Sleep -Milliseconds 100
    foreach ($p in (Receive-Job $jobs))
    {
        # Input adapter doesn't support hashtables yet
        ,,($p['ProcessName'],$p['ComputerName']) 
    }
}

And the payoff

image

1 Comment

Comments have been disabled for this content.