easyMultiple ChoiceObjective-mapped
CAS-004 Practice Question: A Windows administrator needs to automate the…
A Windows administrator needs to automate the retrieval of failed login events from the Security log. Which scripting language is most native and efficient for this task?
⚠ Common exam trap
Watch out — candidates often assume Python or Bash are more 'universal' or efficient for scripting, but the CAS-004 exam emphasizes native integration and administrative efficiency within the specific OS context, and PowerShell's direct cmdlets for Windows Event Log management make it the clear choice over cross-platform languages that require additional libraries or translation layers.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
PowerShell
PowerShell is the most native and efficient scripting language for automating the retrieval of failed login events from the Windows Security log because it provides direct access to the Windows Event Log via the Get-WinEvent cmdlet, which can filter for Event ID 4625 (failed logon) using XPath queries or FilterHashtable for optimal performance. It runs natively on Windows without additional dependencies and integrates seamlessly with the .NET framework and Windows Management Instrumentation (WMI), making it the default automation tool for Windows administrators.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Bash
Why it's wrong here
Bash is not native to Windows and requires WSL.
- ✗
Ruby
Why it's wrong here
Ruby is less common for Windows system administration.
- ✓
PowerShell
Why this is correct
PowerShell natively supports querying Windows Event Log.
- ✗
Python
Why it's wrong here
Python can query Event Log via pywin32 but is not as direct.
Go deeper
Related to this question
About these practice questions
One of 968 original CAS-005 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CAS-005 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CAS-005 exam.