Bird
0
0

You need to monitor the Security event log for new audit failure events in real time and trigger a script when such an event occurs. Which approach is best suited for this task?

hard📝 Application Q9 of 15
PowerShell - System Administration
You need to monitor the Security event log for new audit failure events in real time and trigger a script when such an event occurs. Which approach is best suited for this task?
AUse Get-WinEvent with -MaxEvents 1 repeatedly
BRun Get-EventLog in a loop every minute to check for new events
CExport the Security log daily and parse it manually
DUse Register-ObjectEvent with Get-WinEvent and a filter for audit failures
Step-by-Step Solution
Solution:
  1. Step 1: Understand real-time event monitoring

    Register-ObjectEvent can subscribe to event log changes and trigger actions immediately.
  2. Step 2: Compare with polling methods

    Polling with loops or repeated commands is less efficient and not real-time.
  3. Final Answer:

    Use Register-ObjectEvent with Get-WinEvent and a filter for audit failures -> Option D
  4. Quick Check:

    Real-time monitoring = Register-ObjectEvent [OK]
Quick Trick: Register-ObjectEvent enables real-time event triggers [OK]
Common Mistakes:
  • Using polling loops instead of event subscriptions
  • Assuming export and manual parsing is real-time
  • Misusing -MaxEvents for monitoring

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes