Automating Active Directory Deployment with PowerShell and Ansible
In my previous posts, I have shown how to deploy virtual machines and create templates for them. In this article, I will guide you through the process of installing Active Directory Services on a Windows Server and setting up DNS to create our first domain controller. You can use this guide on any platform, including Nutanix AHV, VMware vSphere, Hyper-V, Microsoft Azure, Amazon AWS, or Google Cloud Platform.
Requirements and Prerequisites
Before we begin, you will need to have provided servers with Windows Server 2012, 2016, or 2019 installed. You can use any of these versions for this guide. Additionally, you will need to have the required roles and features installed on your server. These include Active Directory Domain Services (AD DS), DNS, and the Management Tools.
Step-by-Step Guide
To start, I’ll go over how we install the required roles and features for Microsoft Active Directory Services. We will also install the management tools on the server as well. Here’s each step of the role that can be run with Ensemble:
1. Install Active Directory Domain Services (AD DS)
2. Install DNS
3. Install Management Tools
Once the Roles and Features are installed, we can set up the Active Directory. We will set up the AD Domain and reboot our new Active Directory Controller. After the reboot, we will gather all information from the Server:
1. Gather information about the server
2. Create a central group policy store for our Active Directory
3. Set up the Active Directory Domain
Now that our Active Directory is set up, we can create a central store for the group policies. This is much easier to administrate the admx files from more than one domain controller:
1. Create a central store for the group policies
2. Reboot the server
3. Wait for the system to come up
4. Gather information about the server again
And that’s it! Our Active Directory deployment is now complete. Here are some final steps to ensure everything is set up correctly:
1. Create a central group policy store for our Active Directory
2. Set up the Active Directory Domain
3. Reboot the server
4. Wait for the system to come up
5. Gather information about the server again
Now let’s take a look at your new Active Directory controller 🙂 You will see after you logon to your new domain controller, there are all management tools available. You can now go to your Active Directory console and see that the Domain is prepared and ready to take up your users, groups, and whatnot.
Conclusion
In this guide, we have covered how to automate the deployment of an Active Directory controller using PowerShell and Ansible. We have installed the required roles and features, set up the Active Directory, created a central group policy store, and rebooted the server. This guide is part of a series, and you can find more details in the following article. There, you will also learn more about why the playbooks for Ansible are structured this way.
I hope this post helps you deploy your Active Directory controller with ease. Please let me know if you have any questions or comments by leaving a comment below. You can also share this article via social media.
Your email address will not be published. Required fields are marked * Name Email Website Save my name, email, and website in this browser for the next time I comment. Copyright © 2024 Thomas Preischl