0

Ansible for SQL Server DBAs. Available Now!

Header Logo
Blog DBA Challenges
Courses
Automated Sandbox Framework Ansible for SQL Server DBAs: Level 1
Log In
← Back to all posts
Connect
Share to…
Share

#002 Build Your Own Domain Controller

by Luke Campbell
Aug 17, 2024

 

You may be thinking, "Why do I need to know how to build a DC, I'm a DBA?"

Fortunately, DBAs don't typically build DCs.  However, I've found that knowing a bit about how SQL Server utilizes Active Directory has been very beneficial. 

For instance, I was building a Windows Server Failover Cluster for an employer once.  Doing this as a regular user, not a domain admin, I encountered several errors due to permissions. 

The systems administrators were not familiar with cluster builds and couldn't help.  Access to a DC in my test environment allowed me to work through the permission errors and relay those steps to the systems administrators. 

Plus, I can count the number of SQL Servers I've worked with on one hand that weren't joined to a domain in 18 years.  

This week's challenge is to install and configure Active Directory Domain Services. 

Ready?


Estimated time to complete: Less than 4 hours.


Step 1: Preparing your virtual machine

In last week's challenge, you built two virtual machines; DC1 and SRV1.  DC1 will be our focus today.  

Before making changes to DC1, create a snapshot (one of the benefits of using a virtual machine).  A snapshot is a copy of the state of a virtual machine at a specific time. 

The instructions depend on which hypervisor you have chosen.  Instructions for VMware Workstation and Oracle VirtualBox are below.

 VMware Workstation Pro Snapshot

Oracle VirtualBox Snapshot

If you're using Vagrant, use the vagrant snapshot save command.  In module 6 of the Automated Sandbox Fundamentals course, I cover Hashicorp Vagrant in detail.

The snapshot will be your starting point.  If things go awry, revert the VM and start again.

Step 2: Install Active Directory Domain Services

Before installing ADDS, we'll need to make sure DC1 has a static IP address.  You don't want the domain controller or DNS server changing IPs once the DHCP lease expires. 

Bad things will happen (your client VMs won't be able to connect to the domain or resolve hostnames).

  1. Select an IP address that resides outside the DHCP IP range.  Below is an example of my DHCP settings (vmnet8).  Since my DHCP IP range starts at 192.168.88.128 and ends at 192.168.88.254, I've used 192.168.88.3 for the DC1 IP address.  Be sure to keep track of the IP you assigned.  You'll need it later when configuring your client machines.
  2. Install ADDS.  Check out the link below for steps on how to install using Server Manager or PowerShell.

Install AD DS 

Step 3: Configure your domain

Next, you'll need to promote DC1 to a Domain Controller.  This is the first domain controller, so you'll need to create a new forest. 

Choose a name for your domain during this process (be creative, not like me.  I just used HOMELAB.LOCAL).

Active Directory Forest Set Up 

Step 4: Configure DNS

After promoting DC1 to the domain controller, you'll need to configure DNS forwarders.  Forwarders are external DNS servers like your ISPs or a common public resolver. 

This is where hostnames will be resolved if they reside outside of your sandbox (www.automatesql.com for example).

I use 8.8.8.8 (Google Public DNS) but you can use whatever you like as long as it resolves hostnames.

Resources

If you get stuck, check out the video below.  I set up ADDS during the first 10 minutes.  Be sure to hit that subscribe button while you're there (if, and only if, it was helpful).

SQL Server DBA's Handbook: Navigating Active Directory Integration and Security

 

Helping Others and Sharing Your Results

That's it for this week. 

If you have tips other readers can learn from, please share them in the comments.  You can message me on LinkedIn or post about it and tag me with the #dbachallenges hashtag.

Feedback

If there's a DBA Challenge you'd like to see, please let me know by replying to this email.  Have ideas on how to make these more useful?  I'd love to hear those too.

Good luck and I'm looking forward to seeing your results!

Luke

 

 

Responses

Join the conversation
t("newsletters.loading")
Loading...
#016 Leveraging Ansible Variables to Configure Lock Pages in Memory
You've probably seen it happen.  During peak load on a SQL Server instance, the operating system occasionally pages out parts of SQL Server's memory to disk, causing performance slowdowns.  And you've probably read how Lock Pages in Memory can help address this issue.   Granting this user right can be time-consuming and error-prone when done manually especially if you need to grant the permissi...
#015 Introduction to the Automated Sandbox Framework
2025 is just around the corner, and it's shaping up to be an exciting year for DBAs.  With Windows Server 2025 already here and SQL Server 2025 on the horizon, there's no better time to sharpen your skills and prepare for what's ahead. This year, I've focused on solving a common challenge for DBAs: how to quickly and consistently build test environments for learning and experimentation. In mid-...
#014 Introduction to the Enterprise Policy-Based Management Framework
It's been a few weeks since the last edition.  Life happens--between releasing Ansible for SQL Server DBAs, celebrating Thanksgiving, preparing for Christmas, and juggling the day-to-day demands of being a full-time consultant, it's easy to feel stretched thin.  Have you ever felt that way? But here's a question:  Are we just staying busy or moving toward our goals (we like to think so)?  Are o...

DBA Challenges

Helping you become a more efficient SQL Server Database Administrator through real-world challenges and automation.
Footer Logo
Policies Contact
© 2025 AUTOMATESQL LLC

Five Steps to Spot Automation Opportunities

Wondering if that task you're working on should be automated?  With your free Time Tracker Excel workbook, you're able to easily track and analyze how you spend your time throughout the day.

 

When you signup, we'll send you periodic emails with additional free content. Unsubscribe anytime.