Active Directory account review: a guided PowerShell project
Documentation: Microsoft Learn
Milestone 1 — Inspect account objects
Not checked yet
Inspect Enabled, Department and SamAccountName.
Step through, copy or reset
Run the example to inspect its sample result.
Fictional data. Nothing runs on your device or tenant.
Follow the objects
Each stage shows the objects after one command. Choose Step from start repeatedly to move through the stages, or Run to see the final result.
Run or step through the command to follow its objects.
Inspect the inputs
These fictional objects are reset for every run.
Run and check the milestone
The browser runs supported sample commands against fictional objects. Nothing runs on your device or tenant.
- Open Sample data to inspect the input objects.
- Edit the command, then choose Run to see its final result.
- Choose Step from start repeatedly to inspect each pipeline stage in order.
- Choose Check answer to compare the final rows and properties with the milestone.
Reset restores the editor. Saved completion stays in your progress history.
PowerShell normally streams objects between commands. Sort-Object and Group-Object need their inputs before returning their grouped or sorted results; these sample stage snapshots show the result after each command.
Read the pipeline lesson →Milestone 2 — Find disabled accounts
Not checked yet
Filter Enabled false. Inventory is not approval to delete.
Step through, copy or reset
Run the example to inspect its sample result.
Fictional data. Nothing runs on your device or tenant.
Follow the objects
Each stage shows the objects after one command. Choose Step from start repeatedly to move through the stages, or Run to see the final result.
Run or step through the command to follow its objects.
Inspect the inputs
These fictional objects are reset for every run.
Run and check the milestone
The browser runs supported sample commands against fictional objects. Nothing runs on your device or tenant.
- Open Sample data to inspect the input objects.
- Edit the command, then choose Run to see its final result.
- Choose Step from start repeatedly to inspect each pipeline stage in order.
- Choose Check answer to compare the final rows and properties with the milestone.
Reset restores the editor. Saved completion stays in your progress history.
PowerShell normally streams objects between commands. Sort-Object and Group-Object need their inputs before returning their grouped or sorted results; these sample stage snapshots show the result after each command.
Read the pipeline lesson →Milestone 3 — Review IT users
Not checked yet
Scope the review to Department IT.
Step through, copy or reset
Run the example to inspect its sample result.
Fictional data. Nothing runs on your device or tenant.
Follow the objects
Each stage shows the objects after one command. Choose Step from start repeatedly to move through the stages, or Run to see the final result.
Run or step through the command to follow its objects.
Inspect the inputs
These fictional objects are reset for every run.
Run and check the milestone
The browser runs supported sample commands against fictional objects. Nothing runs on your device or tenant.
- Open Sample data to inspect the input objects.
- Edit the command, then choose Run to see its final result.
- Choose Step from start repeatedly to inspect each pipeline stage in order.
- Choose Check answer to compare the final rows and properties with the milestone.
Reset restores the editor. Saved completion stays in your progress history.
PowerShell normally streams objects between commands. Sort-Object and Group-Object need their inputs before returning their grouped or sorted results; these sample stage snapshots show the result after each command.
Read the pipeline lesson →Milestone 4 — Choose reviewer columns
Not checked yet
Select Name, SamAccountName, Enabled and Department.
Step through, copy or reset
Run the example to inspect its sample result.
Fictional data. Nothing runs on your device or tenant.
Follow the objects
Each stage shows the objects after one command. Choose Step from start repeatedly to move through the stages, or Run to see the final result.
Run or step through the command to follow its objects.
Inspect the inputs
These fictional objects are reset for every run.
Run and check the milestone
The browser runs supported sample commands against fictional objects. Nothing runs on your device or tenant.
- Open Sample data to inspect the input objects.
- Edit the command, then choose Run to see its final result.
- Choose Step from start repeatedly to inspect each pipeline stage in order.
- Choose Check answer to compare the final rows and properties with the milestone.
Reset restores the editor. Saved completion stays in your progress history.
PowerShell normally streams objects between commands. Sort-Object and Group-Object need their inputs before returning their grouped or sorted results; these sample stage snapshots show the result after each command.
Read the pipeline lesson →Milestone 5 — Deliver exceptions
Not checked yet
Show only disabled accounts with reviewer-friendly columns.
Step through, copy or reset
Run the example to inspect its sample result.
Fictional data. Nothing runs on your device or tenant.
Follow the objects
Each stage shows the objects after one command. Choose Step from start repeatedly to move through the stages, or Run to see the final result.
Run or step through the command to follow its objects.
Inspect the inputs
These fictional objects are reset for every run.
Run and check the milestone
The browser runs supported sample commands against fictional objects. Nothing runs on your device or tenant.
- Open Sample data to inspect the input objects.
- Edit the command, then choose Run to see its final result.
- Choose Step from start repeatedly to inspect each pipeline stage in order.
- Choose Check answer to compare the final rows and properties with the milestone.
Reset restores the editor. Saved completion stays in your progress history.
PowerShell normally streams objects between commands. Sort-Object and Group-Object need their inputs before returning their grouped or sorted results; these sample stage snapshots show the result after each command.
Read the pipeline lesson →Defend it
Explain what the report establishes and what you would verify before acting on a real system.
Compare with a model defense
The sample list identifies disabled accounts, not their owners, last sign-in or retention status. Verify those facts and obtain approval before changing an account.
Directory review handover
Deliver a usable report
Record the domain, collection time, SamAccountName, Enabled and Department. Request non-default properties explicitly on the real Get-ADUser query.
Test the failure path
The query runs against the wrong domain, or Department is empty. Check the target server and -Properties Department before interpreting a blank as an absent value.
Verify before handing over
Recheck two account identities in the intended directory. An inventory of disabled accounts is not authorization to delete them.
Complete each checked milestone above. Completion records show practice against fictional data; they do not certify a production script.
Apply this project to the next admin taskPractise the next scenario
Report disabled accounts
Import ActiveDirectory first. Return SamAccountName and Enabled for disabled users.
The sandbox is visible now. Sign in with Google only when you run or check a task; commands and temporary files are discarded when you leave.
Run a command to inspect its result.