0
0
PowerShellscripting~10 mins

Why AD management is essential for sysadmins in PowerShell - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to list all users in Active Directory.

PowerShell
Get-ADUser -Filter [1]
Drag options to blanks, or click blank then click option'
A*
BName
CUser
DAll
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'All' or 'User' instead of '*' causes errors.
2fill in blank
medium

Complete the code to create a new Active Directory user named 'JohnDoe'.

PowerShell
New-ADUser -Name 'JohnDoe' -AccountPassword (ConvertTo-SecureString [1] -AsPlainText -Force) -Enabled $true
Drag options to blanks, or click blank then click option'
A'password123'
B'Password!'
C'123456'
D'adminpass'
Attempts:
3 left
💡 Hint
Common Mistakes
Using weak passwords causes creation failure.
3fill in blank
hard

Fix the error in the code to disable a user account named 'JaneSmith'.

PowerShell
Disable-ADAccount -Identity [1]
Drag options to blanks, or click blank then click option'
AJaneSmith
BUser.JaneSmith
Cjane.smith
D'JaneSmith'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes causes errors.
4fill in blank
hard

Fill both blanks to get all enabled users whose name starts with 'A'.

PowerShell
Get-ADUser -Filter "[1] -and Enabled -eq [2]"
Drag options to blanks, or click blank then click option'
AName -like 'A*'
BName -eq 'A*'
CName -contains 'A'
DTrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using -eq with wildcard does not work as expected.
5fill in blank
hard

Fill all three blanks to create a new user with a given name, surname, and enable the account.

PowerShell
New-ADUser -Name 'Alice Smith' -GivenName [1] -Surname [2] -AccountPassword (ConvertTo-SecureString 'Password!' -AsPlainText -Force) -Enabled [3]
Drag options to blanks, or click blank then click option'
A'Alice'
B'Smith'
C$true
D$false
Attempts:
3 left
💡 Hint
Common Mistakes
Using $false disables the account.