Remote events

All event types that we explored in this section can also be used with remote systems. Events generated on those remote systems will be forwarded to the caller session to be further processed. With the Get-Event cmdlet, those can be retrieved and examined:

Register-CimIndicationEvent -Query "SELECT * FROM CIM_InstModification WITHIN 5 WHERE targetInstance ISA 'WIN32_Service'" `
-SourceIdentifier CimServiceModified -Action $actionScript -ComputerName NODE01

# Events created in the remote session are queued and can be
# collected at the local session
Get-Event -SourceIdentifier CimServiceModified

Using the same example with the additional ComputerName parameter is all that it takes to enable the remote collection of events. Be aware that the results will be processed in your session if a listener is created in this fashion.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset