Bird
0
0

Which PowerShell command correctly lists all Active Directory users who are currently enabled?

easy📝 Syntax Q3 of 15
PowerShell - Active Directory
Which PowerShell command correctly lists all Active Directory users who are currently enabled?
AGet-ADUser -Filter {Enabled -eq true} | Select-Object Name
BGet-ADUser -Filter Enabled = true | Select Name
CGet-ADUser -Filter 'Enabled -eq $true' | Select-Object Name
DGet-ADUser -Filter 'Enabled == true' | Select Name
Step-by-Step Solution
Solution:
  1. Step 1: Understand Get-ADUser filter syntax

    The filter parameter requires a string with a valid PowerShell expression.
  2. Step 2: Correct syntax

    'Enabled -eq $true' is the correct syntax to filter enabled users.
  3. Step 3: Selecting the Name property

    Select-Object Name correctly extracts the Name property.
  4. Final Answer:

    Get-ADUser -Filter 'Enabled -eq $true' | Select-Object Name -> Option C
  5. Quick Check:

    Filter uses single quotes and -eq operator [OK]
Quick Trick: Use single quotes and -eq for filters [OK]
Common Mistakes:
  • Using '=' instead of '-eq' in filter
  • Using double equals '==' which is invalid in filter string
  • Incorrectly using script block {} in filter parameter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes