0

Is there an exposed object related to the object that triggered the event?

I'm trying to create a trigger that fires on an event and then kick off a PowerShell script that runs, deterministically logs information from that specific event, where required.

What I'm looking for is analogous to the WMI Asynchronous Subscription information where an event log item returns an $Event.NewEvent() object that contains all of the relevant data about the event that fired the subscription.

In the case of Scheduled Task -> Event triggers, do I need to re-query the event log for my data or is there a way to access the data in the event that triggered the scheduled task?

thepip3r
  • 2,855
  • 6
  • 32
  • 38

1 Answers1

0

Try

gwmi -Namespace Root\cimv2 -class Win32_ScheduledJob

for getting the list of all scheduled tasks.

Reference

Amit Shakya
  • 1,396
  • 12
  • 27