Challenge - 5 Problems
Bulk User Operations 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 PowerShell script reading a CSV?
Given a CSV file named users.csv with the following content:
What will this script output?
Username,Email alice,alice@example.com bob,bob@example.com
What will this script output?
Import-Csv users.csv | ForEach-Object { "User: $($_.Username), Email: $($_.Email)" }PowerShell
Import-Csv users.csv | ForEach-Object { "User: $($_.Username), Email: $($_.Email)" }Attempts:
2 left
💡 Hint
Think about how Import-Csv creates objects and how ForEach-Object accesses properties.
✗ Incorrect
Import-Csv reads the CSV and creates objects with properties Username and Email. The script outputs formatted strings for each user.
📝 Syntax
intermediate2:00remaining
Which option correctly updates user emails from CSV in PowerShell?
You want to update user emails in Active Directory from a CSV file with columns Username and NewEmail. Which script snippet correctly updates the email attribute for each user?
Attempts:
2 left
💡 Hint
Check the parameter names for Set-ADUser and how to access CSV properties.
✗ Incorrect
Set-ADUser uses -Identity for the user and -EmailAddress for the email attribute. $_.Username and $_.NewEmail correctly access CSV columns.
🔧 Debug
advanced2:00remaining
Why does this bulk user creation script fail?
This script is intended to create users from a CSV file with Username and Password columns:
What is the cause of the error?
Import-Csv users.csv | ForEach-Object {
New-ADUser -Name $_.Username -AccountPassword (ConvertTo-SecureString $_.Password) -Enabled $true
}What is the cause of the error?
PowerShell
Import-Csv users.csv | ForEach-Object {
New-ADUser -Name $_.Username -AccountPassword (ConvertTo-SecureString $_.Password) -Enabled $true
}Attempts:
2 left
💡 Hint
Think about how ConvertTo-SecureString handles plain text input.
✗ Incorrect
ConvertTo-SecureString needs -AsPlainText and -Force to convert plain text passwords; otherwise, it throws an error.
🚀 Application
advanced2:00remaining
How to safely disable multiple users from a CSV list?
You have a CSV file with a list of usernames to disable in Active Directory. Which script snippet safely disables these users and logs each action to a file named disable_log.txt?
Attempts:
2 left
💡 Hint
Check the correct parameter names and how to append text to a file.
✗ Incorrect
Disable-ADAccount uses -Identity parameter. Add-Content appends text to a file, preserving previous content.
🧠 Conceptual
expert2:00remaining
What is the main benefit of using Import-Csv with pipeline in bulk user operations?
Why is using Import-Csv piped into ForEach-Object a preferred method for bulk user operations in PowerShell?
Attempts:
2 left
💡 Hint
Think about how PowerShell treats CSV data and pipelines.
✗ Incorrect
Import-Csv converts CSV rows into objects, which can be processed one by one in the pipeline, making scripting flexible and readable.