July 2018
Beginner
552 pages
13h 18m
English
As we mentioned, object events are the bread and butter of developers, but that doesn't mean that operations people shouldn't be using them. One such event that is quite useful in an enterprise scenario is an event log subscription. In a running PowerShell session, you can attach to the event log and subscribe certain events, for example, all events in the application log with ID 1001 and the source Windows Error Reporting. Now, each time an event is generated on the system, the event log listener in your session kicks off and processes the event when it is written to the event log:
$eventLogQuery = @"<QueryList><Query Id="0" Path="Application"> <Select Path="Application">*[System[(EventID=1001)]]</Select></Query></QueryList> ...
Read now
Unlock full access