Bird
0
0

Identify the error in this script:

medium📝 Debug Q6 of 15
PowerShell - Active Directory
Identify the error in this script:
New-ADUser -SamAccountName 'lwilson' -Name 'Linda Wilson' -AccountPassword 'Password123' -Enabled $true
AEnabled parameter cannot be used with New-ADUser
BSamAccountName cannot contain lowercase letters
CName parameter is invalid
DAccountPassword must be a SecureString, not plain text
Step-by-Step Solution
Solution:
  1. Step 1: Check AccountPassword parameter type

    AccountPassword requires a SecureString, not a plain text string.
  2. Step 2: Validate other parameters

    SamAccountName accepts lowercase, Name is valid, Enabled is allowed.
  3. Final Answer:

    AccountPassword must be a SecureString, not plain text -> Option D
  4. Quick Check:

    Password must be SecureString for New-ADUser [OK]
Quick Trick: Always convert password to SecureString before New-ADUser [OK]
Common Mistakes:
  • Passing plain text password directly
  • Misunderstanding parameter types
  • Assuming Enabled is invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes