Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Why AD management is essential for sysadmins
📖 Scenario: Imagine you are a system administrator managing a company's network. Active Directory (AD) helps you organize users, computers, and resources securely and efficiently.
🎯 Goal: You will create a simple PowerShell script that shows how AD management helps sysadmins by listing users and checking their account status.
📋 What You'll Learn
Create a list of user accounts with their status
Set a threshold for inactive accounts
Filter users who have been inactive longer than the threshold
Print the filtered list of inactive users
💡 Why This Matters
🌍 Real World
System administrators use Active Directory management to keep networks secure by monitoring user activity and disabling inactive accounts.
💼 Career
Knowing how to script AD user management tasks saves time and reduces errors in daily sysadmin work.
Progress0 / 4 steps
1
Create the user accounts list
Create a variable called users that holds a list of hashtables. Each hashtable should have Name and LastLogonDays keys with these exact entries: @{Name='Alice'; LastLogonDays=10}, @{Name='Bob'; LastLogonDays=45}, @{Name='Charlie'; LastLogonDays=5}, @{Name='Diana'; LastLogonDays=60}.
PowerShell
Hint
Use an array of hashtables to store user names and their last logon days.
2
Set the inactivity threshold
Create a variable called inactiveThreshold and set it to 30 to represent days of inactivity.
PowerShell
Hint
Use a simple variable to hold the number 30.
3
Filter inactive users
Create a variable called inactiveUsers that uses Where-Object to filter users where LastLogonDays is greater than inactiveThreshold.
PowerShell
Hint
Use Where-Object with a script block comparing LastLogonDays to inactiveThreshold.
4
Display inactive users
Use Write-Output to print the Name of each user in inactiveUsers.
PowerShell
Hint
Use a foreach loop to print each inactive user's name.
Practice
(1/5)
1. Why is Active Directory (AD) management important for system administrators?
easy
A. It helps control user access to network resources.
B. It allows users to install any software they want.
C. It slows down network performance.
D. It removes all security settings automatically.
Solution
Step 1: Understand AD's role in access control
Active Directory manages who can access files, printers, and other resources on a network.
Step 2: Recognize sysadmin responsibilities
Sysadmins use AD to set permissions and keep the network secure and organized.
Final Answer:
It helps control user access to network resources. -> Option A
Quick Check:
AD controls access = A [OK]
Hint: AD controls access rights for users and devices [OK]
Common Mistakes:
Thinking AD slows down the network
Believing AD removes security settings
Assuming AD lets users install any software
2. Which PowerShell cmdlet is used to create a new Active Directory user?