I'm seeking a solution to fully automate the deployment of multiple Active Directory lab environments. The deployment should cover various requirements, including setting up 2 Domain Controllers, 2 File Servers, 2 Certificate Authorities (AD CS), and 3 to 5 clients. Flexibility is essential, so I need the ability to scale the number of clients or member servers as needed. My core goals include full automation with one-command deployment, no manual domain joining, automatic AD DS promotion, AD CS installation, DNS setup, and potentially optional GPO baseline deployment. I also want to deploy different variants of domains, including a default non-hardened domain and a hardened domain with a predefined GPO baseline. Reproducibility is crucial, meaning I want a clean rebuild capability without snapshot-based resets. The infrastructure should be managed using an Infrastructure-as-Code approach, preferably on Proxmox, but I'm open to hypervisor-agnostic solutions. Are there existing frameworks or products that support this? Has anyone created something similar with Terraform, Ansible, Packer, or other tools? What would be the best long-term approach for maintainability? I'm aiming for a solution that's reproducible, scalable, and suitable for security testing and hardening validation. Thanks for any input!
4 Answers
This is totally doable! Start by automating one server type and scale from there. I built a hardening script years ago that set up OUs, added users, and imported GPOs without breaking a sweat. Just focus on scripting those repetitive tasks. I've used PowerCLI for similar problems and automated a lot of setup using prebuilt VM images. You can definitely get something reliable up and running.
Using PowerShell is one of the best routes you can take for automation in this scenario. It offers a robust level of control for automating AD and server setups. If you haven’t already, consider diving deeper into PowerShell scripts to cover the areas you need!
I don't think there's a fully automated system that covers all your needs out-of-the-box. However, combining tools like Terraform for infrastructure and using PowerShell for core tasks could be the way to go. Check out Deployment Bunny (Mikael Nystrom); he has some interesting work on automating deployments, although it was more geared towards Hyper-V. You might need to adapt those ideas for Proxmox.
I'm really curious about your exact use case! It sounds like saving a ton of time on setup is a priority. But are you looking for two distinct environments? One for casual testing and another hardened for demonstrations? Do you need to reset the demo environment regularly, or is it more of a static setup?

Exactly! I want one environment as a playground where people can experiment, and a separate demo that follows best practices. The demo shouldn't need constant resets, unlike the lab.