Bird
0
0

Which of the following is the correct syntax to get a user by their username using Get-ADUser?

easy📝 Syntax Q12 of 15
PowerShell - Active Directory
Which of the following is the correct syntax to get a user by their username using Get-ADUser?
AGet-ADUser -Identity "jdoe"
BGet-ADUser -Name "jdoe"
CGet-ADUser -UserName "jdoe"
DGet-ADUser -User "jdoe"
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct parameter for a single user

    The -Identity parameter is used to specify a single user by username or distinguished name.
  2. Step 2: Check other parameters

    Parameters like -Name, -UserName, or -User are not valid for Get-ADUser to specify a single user.
  3. Final Answer:

    Get-ADUser -Identity "jdoe" -> Option A
  4. Quick Check:

    -Identity = single user [OK]
Quick Trick: Use -Identity to specify one user by username [OK]
Common Mistakes:
  • Using -Name instead of -Identity
  • Trying -UserName which is invalid
  • Confusing parameter names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes