Challenge - 5 Problems
AD User Management Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this New-ADUser command?
You run this PowerShell command to create a new Active Directory user:
What does the command output?
New-ADUser -Name "John Doe" -GivenName "John" -Surname "Doe" -SamAccountName "jdoe" -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force) -Enabled $true -PassThru
What does the command output?
PowerShell
New-ADUser -Name "John Doe" -GivenName "John" -Surname "Doe" -SamAccountName "jdoe" -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force) -Enabled $true -PassThru
Attempts:
2 left
💡 Hint
The -PassThru parameter makes the command output the created user object.
✗ Incorrect
By default, New-ADUser does not output anything. Using -PassThru returns the user object created, showing details like Name and SamAccountName.
💻 Command Output
intermediate2:00remaining
What happens when you run this Set-ADUser command?
You want to update the title of an existing user with SamAccountName 'jdoe'. You run:
What is the output of this command?
Set-ADUser -Identity jdoe -Title "Senior Developer"
What is the output of this command?
PowerShell
Set-ADUser -Identity jdoe -Title "Senior Developer"Attempts:
2 left
💡 Hint
Set-ADUser updates attributes silently unless you request output.
✗ Incorrect
Set-ADUser does not output anything by default. It updates the user attribute silently.
📝 Syntax
advanced2:00remaining
Which option correctly creates a new AD user with a secure password?
You want to create a new AD user with username 'asmith' and password 'Secret123!'. Which command is syntactically correct?
Attempts:
2 left
💡 Hint
AccountPassword expects a secure string, so use parentheses to convert the plain text password.
✗ Incorrect
Option B correctly uses parentheses to convert the plain text password to a secure string. Option B misses parentheses, causing a syntax error. Option B passes a plain string, which is invalid. Option B uses incorrect syntax for the ConvertTo-SecureString cmdlet.
🚀 Application
advanced2:00remaining
How to change multiple attributes of an AD user in one command?
You want to update the user 'jdoe' to have Title 'Manager' and Office 'HQ-101'. Which command achieves this?
Attempts:
2 left
💡 Hint
Set-ADUser supports multiple attribute parameters directly.
✗ Incorrect
Option A correctly updates multiple attributes in one command. Option A works but uses two commands, not one. Option A uses -Replace which is valid but less straightforward here. Option A uses -Add which is for multi-valued attributes and will cause an error for single-valued attributes.
🔧 Debug
expert2:00remaining
Why does this New-ADUser command fail with an error?
You run:
and get an error about missing parameters. What is the cause?
New-ADUser -Name "Bob Lee" -SamAccountName "blee" -AccountPassword (ConvertTo-SecureString "Pass123" -AsPlainText) -Enabled $true
and get an error about missing parameters. What is the cause?
PowerShell
New-ADUser -Name "Bob Lee" -SamAccountName "blee" -AccountPassword (ConvertTo-SecureString "Pass123" -AsPlainText) -Enabled $true
Attempts:
2 left
💡 Hint
ConvertTo-SecureString requires -Force when using -AsPlainText.
✗ Incorrect
Without the -Force flag, ConvertTo-SecureString with -AsPlainText throws an error. This causes New-ADUser to fail because the password is not properly converted.