Bird
0
0

Identify the error in this command:

medium📝 Debug Q7 of 15
PowerShell - Active Directory
Identify the error in this command:
Set-ADUser -Identity 'asmith' -EmailAddress 'asmith@example.com'
AThe user 'asmith' does not exist
BThe parameter '-EmailAddress' is invalid for Set-ADUser
CMissing -Enabled parameter
DThe command should use New-ADUser instead
Step-by-Step Solution
Solution:
  1. Step 1: Check Set-ADUser parameters

    -EmailAddress is not a valid parameter for Set-ADUser.
  2. Step 2: Correct way to set email

    Email is set via -Email or by modifying the mail attribute using -Replace @{mail='...'}.
  3. Step 3: User existence

    Assuming user 'asmith' exists; error is parameter misuse.
  4. Final Answer:

    The parameter '-EmailAddress' is invalid for Set-ADUser -> Option B
  5. Quick Check:

    Use correct attribute names with Set-ADUser [OK]
Quick Trick: Set-ADUser does not have -EmailAddress parameter [OK]
Common Mistakes:
  • Using incorrect parameter names like -EmailAddress
  • Confusing New-ADUser and Set-ADUser parameters
  • Assuming -Enabled is required for updates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes