0
0
PowerShellscripting~20 mins

Get-ADUser in PowerShell - Mini Project: Build & Apply

Choose your learning style9 modes available
Using Get-ADUser to List Active Directory Users
📖 Scenario: You are an IT administrator who needs to get a list of users from Active Directory to check their details.
🎯 Goal: Learn how to use the Get-ADUser cmdlet to retrieve user information from Active Directory and display it.
📋 What You'll Learn
Use the Get-ADUser cmdlet to get user data
Filter users by a specific property
Select specific properties to display
Display the results in the console
💡 Why This Matters
🌍 Real World
IT administrators often need to list and manage Active Directory users to maintain security and organization.
💼 Career
Knowing how to use Get-ADUser is essential for system administrators and IT support professionals working with Windows Server environments.
Progress0 / 4 steps
1
Create a variable with a list of all Active Directory users
Write a line of PowerShell code to create a variable called allUsers that stores all users from Active Directory using Get-ADUser -Filter *.
PowerShell
Need a hint?

Use Get-ADUser -Filter * to get all users and assign it to allUsers.

2
Add a filter to get only enabled users
Add a line of code to create a variable called enabledUsers that stores only users from allUsers where the Enabled property is $true.
PowerShell
Need a hint?

Use Where-Object to filter allUsers by Enabled -eq $true.

3
Select specific properties to display
Write a line of code to create a variable called userDetails that selects the Name, SamAccountName, and EmailAddress properties from enabledUsers.
PowerShell
Need a hint?

Use Select-Object to pick the properties you want from enabledUsers.

4
Display the user details
Write a line of code to print the userDetails variable to the console.
PowerShell
Need a hint?

Simply output the userDetails variable to show the data.