Bird
0
0

This command returns no results:

medium📝 Debug Q7 of 15
PowerShell - Active Directory
This command returns no results:
Get-ADUser -Filter 'Department -eq Sales'

What is the likely cause?
AThe user running the command lacks permissions
BDepartment is not a valid attribute
CGet-ADUser cannot filter by Department
DMissing quotes around Sales in the filter
Step-by-Step Solution
Solution:
  1. Step 1: Check filter syntax

    The value 'Sales' must be in quotes inside the filter string to be recognized as a string literal.
  2. Step 2: Validate attribute and permissions

    Department is a valid attribute, and filtering by it is supported. Permissions issues usually cause errors, not empty results.
  3. Final Answer:

    Missing quotes around Sales in the filter -> Option D
  4. Quick Check:

    String values in filter need quotes [OK]
Quick Trick: Quote string values inside filter expressions [OK]
Common Mistakes:
  • Not quoting string values in filter
  • Assuming attribute is invalid
  • Confusing empty results with permission errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes