Active Directory Test Data That Doesn't Suck

Tired of cobbling together half-baked AD sample data from the internet? Yeah, me too.

I've been doing some testing lately and was disappointed with what I found for pre-existing AD data packs on the web. Some are very basic, others require manual edits for your specific domain, and don't get me started on the ones that need Python installed first. So naturally, I built my own – with blackjack and hookers! (Okay, just better test data, but you get the idea.)

I used https://github.com/aserto-demo/contoso-ad-sample as my starter and then added devices, groups, and service accounts for flavor. There should be meaningful attributes and relationships to evaluate various things on. Everything is PowerShell 5.1 compliant so this should work on any relatively modern Windows Server or 10/11 device with RSAT installed.

What you get:

  • 290 Users, 87 groups, 688 devices, and 25 service accounts
  • PowerShell 5.1 compliant (works on any modern Windows Server or client with RSAT)
  • Batched creation for better performance
  • Easy cleanup commands
  • Multiple export formats for reporting

Getting Started

Grab it from GitHub: https://github.com/fadwen/TechbyJeff/tree/main/Powershell/Active Directory/ADTestEnvironment

Either git clone the repo or just download via browser (no judgment here).

Import-Module .\ADTestEnvironment.psd1
New-ADTestEnvironment

Everything gets created in a top-level TestData OU for easy reference. I built batching into it so with default data and switches it should take a little over a minute for the end-to-end creation.

Cleanup (The Important Part)

When you're done breaking things:

Remove-ADTestEnvironment -RemoveOUs -Force

This nukes the entire TestData OU and everything in it – no prompts, no mercy. Takes about a minute.

You'll notice it also spits out a ServiceAccountPW-timestamp.txt file to use if you want to use the premade secrets.

There is also Get-ADTestEnvironmentReport if you'd like to use this in other automations. Default is PSCustomObject output for -Passthru but you can also have HTML, JSON, or CSV outputs. The HTML report is 100% ai assisted since I'm not front-end, so don't yell at me if the css etc is jank.

Want to Customize?

All the sample data lives in CSV files within the module's Data folder. The naming should be pretty self-explanatory, but if it's not, that's a documentation problem I'll fix eventually. Most everything generates dynamically except security groups and their memberships (because those relationships matter).

That's a Wrap

This thing exists because I got tired of building the same test objects over and over. If it helps you out, awesome. If you break something with it, that's a you problem (but seriously, file an issue and I'll try to help).

Contributions welcome, feedback appreciated, and remember – it's just test data until someone puts it in production. Don't be that person.

Happy testing! 🚀