Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new Active Directory user with the name 'John Doe'.
PowerShell
New-ADUser -Name [1] -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force) -Enabled $true
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put the name in quotes.
Using single quotes which may work but double quotes are preferred here.
Using a username instead of the full name.
✗ Incorrect
The -Name parameter requires the full name as a string. Using double quotes "John Doe" is correct.
2fill in blank
mediumComplete the code to set the user's department to 'Sales' using Set-ADUser.
PowerShell
Set-ADUser -Identity "jdoe" -[1] "Sales"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -Title or -Office instead of -Department.
Forgetting the dash before the parameter.
✗ Incorrect
The -Department parameter sets the department attribute for the user.
3fill in blank
hardFix the error in the code to enable the user account after creation.
PowerShell
New-ADUser -Name "Jane Smith" -AccountPassword (ConvertTo-SecureString "P@ss1234" -AsPlainText -Force) [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -Enable instead of -Enabled.
Using non-existent parameters like -EnableAccount.
✗ Incorrect
The correct parameter to enable the account is -Enabled followed by $true.
4fill in blank
hardFill both blanks to create a new user with a given username and set the email address.
PowerShell
New-ADUser -Name "[1]" -SamAccountName [2] -AccountPassword (ConvertTo-SecureString "Pass123!" -AsPlainText -Force) -Enabled $true Set-ADUser -Identity [2] -EmailAddress "[1]@example.com"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the username.
Using the full name as the username.
Mixing up the parameters.
✗ Incorrect
The -Name parameter needs the full name in quotes, and -SamAccountName needs the username as a string in quotes.
5fill in blank
hardFill all three blanks to create a user, enable the account, and set the office location.
PowerShell
New-ADUser -Name [1] -SamAccountName [2] -AccountPassword (ConvertTo-SecureString "Secret123" -AsPlainText -Force) [3] Set-ADUser -Identity [2] -Office "HQ"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using -Enable instead of -Enabled.
Not quoting the name or username.
Forgetting to enable the account.
✗ Incorrect
The name and username must be strings in quotes, and the correct parameter to enable the account is -Enabled $true.