0
0
PowerShellscripting~20 mins

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

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
AD Management Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Why is Active Directory (AD) management crucial for sysadmins?
Which of the following best explains why sysadmins must manage Active Directory effectively?
ABecause AD is only used for storing files and has no impact on network security.
BBecause AD automatically manages all network devices without any sysadmin intervention.
CBecause AD is a backup system for user data and does not affect user authentication.
DBecause AD controls user access and security policies across the network, ensuring proper permissions and compliance.
Attempts:
2 left
💡 Hint
Think about what AD controls in a network environment.
💻 Command Output
intermediate
2:00remaining
Output of a PowerShell command to list AD users
What is the output of this PowerShell command? Get-ADUser -Filter * -Properties Name | Select-Object -First 3 -ExpandProperty Name
PowerShell
Get-ADUser -Filter * -Properties Name | Select-Object -First 3 -ExpandProperty Name
A["Name", "Name", "Name"]
BError: The term 'Get-ADUser' is not recognized as the name of a cmdlet
C["Alice", "Bob", "Charlie"]
DEmpty output
Attempts:
2 left
💡 Hint
Get-ADUser lists users; Select-Object picks first 3 names.
📝 Syntax
advanced
2:30remaining
Identify the syntax error in this AD user creation script
Which option contains the correct syntax to create a new AD user with PowerShell?
PowerShell
New-ADUser -Name "John Doe" -SamAccountName "jdoe" -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force) -Enabled $true
ANew-ADUser -Name "John Doe" -SamAccountName "jdoe" -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force) -Enabled $true
BNew-ADUser -Name "John Doe" -SamAccountName "jdoe" -AccountPassword ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force -Enabled $true
CNew-ADUser -Name "John Doe" -SamAccountName "jdoe" -AccountPassword "P@ssw0rd" -Enabled $true
DNew-ADUser -Name "John Doe" -SamAccountName "jdoe" -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -Force) -Enabled $true
Attempts:
2 left
💡 Hint
AccountPassword needs a secure string wrapped in parentheses.
🔧 Debug
advanced
2:00remaining
Why does this AD group membership script fail?
This script is supposed to add a user to a group but fails. What is the error? Add-ADGroupMember -Identity "Admins" -Members "jdoe"
PowerShell
Add-ADGroupMember -Identity "Admins" -Members "jdoe"
AError: Cannot find an object with identity: 'jdoe' because it does not exist or you do not have permission.
BError: The parameter -Members is not recognized.
CSuccess: User 'jdoe' added to group 'Admins'.
DError: The group 'Admins' does not exist.
Attempts:
2 left
💡 Hint
Check if the user 'jdoe' exists and permissions.
🚀 Application
expert
3:00remaining
Automate user account expiration notification
You want to write a PowerShell script that finds all AD users whose accounts expire within 7 days and sends an email notification. Which snippet correctly filters these users?
PowerShell
Get-ADUser -Filter {AccountExpirationDate -le $dateLimit} -Properties AccountExpirationDate
A$dateLimit = (Get-Date).AddDays(7); Get-ADUser -Filter {AccountExpirationDate -le '$dateLimit'} -Properties AccountExpirationDate
B$dateLimit = (Get-Date).AddDays(7); Get-ADUser -Filter {AccountExpirationDate -le $dateLimit} -Properties AccountExpirationDate
C$dateLimit = (Get-Date).AddDays(7); Get-ADUser -Filter 'AccountExpirationDate -le $dateLimit' -Properties AccountExpirationDate
D$dateLimit = (Get-Date).AddDays(7); Get-ADUser -Filter {AccountExpirationDate -lt (Get-Date).AddDays(7)} -Properties AccountExpirationDate
Attempts:
2 left
💡 Hint
Use a variable for the date and a script block filter.