How to Setup a Basic Home Lab Running Active Directory (Oracle VirtualBox) | Add Users w/PowerShell
4 min read
5 hours ago
Published on Jan 18, 2025
This response is partially generated with the help of AI. It may contain inaccuracies.
Table of Contents
Introduction
This tutorial will guide you through setting up a basic home lab running Active Directory using Oracle VirtualBox. You'll learn how to install Windows Server 2019 and Windows 10, configure Active Directory, and manage users with PowerShell. This is a valuable skill for anyone interested in IT and cybersecurity.
Step 1: Install Oracle VirtualBox
- Download Oracle VirtualBox
- Visit the VirtualBox Downloads page and download the latest version for your operating system.
- Install VirtualBox
- Open the downloaded installer and follow the prompts to complete the installation.
Step 2: Download Required ISOs
- Windows Server 2019 ISO
- Go to the Windows Server 2019 Evaluation Center and download the ISO file.
- Windows 10 ISO
- Visit the Windows 10 Download page and download the ISO file.
Step 3: Set Up Virtual Machines
- Create a Virtual Machine for Windows Server 2019
- Open VirtualBox and click on "New."
- Name your VM (e.g., "Windows Server 2019") and choose "Windows" as the type and "Windows 2019 (64-bit)" as the version.
- Allocate at least 2 GB of RAM.
- Create a new virtual hard disk and set the size to at least 50 GB.
- Select the Windows Server 2019 ISO as the startup disk.
- Create a Virtual Machine for Windows 10
- Repeat the steps above, but name the VM "Windows 10" and allocate similar resources.
Step 4: Install Windows Server 2019
- Start the Server VM
- Select your Windows Server VM and click "Start."
- Follow Installation Prompts
- Choose your language, time, and keyboard settings.
- Click "Install now" and select the appropriate edition (Standard or Datacenter).
- Accept the license terms and choose "Custom: Install Windows only."
- Select the virtual hard disk you created and click "Next" to begin the installation.
- Configure Initial Settings
- After installation, set a strong administrator password.
Step 5: Install Active Directory
- Open Server Manager
- Once logged in, open the Server Manager dashboard.
- Add Roles and Features
- Click on "Add roles and features."
- Follow the wizard to install the Active Directory Domain Services role.
- Promote to Domain Controller
- After installing the role, click the notification flag in Server Manager and select "Promote this server to a domain controller."
- Choose "Add a new forest" and enter a domain name (e.g., "mydomain.local").
- Set a DSRM password and complete the wizard.
Step 6: Install Windows 10
- Start the Windows 10 VM
- Select your Windows 10 VM and click "Start."
- Follow Installation Prompts
- Similar to the server installation, configure language and regional settings.
- Complete the installation process and set up a user account.
Step 7: Create User Accounts Using PowerShell
- Access PowerShell
- Open PowerShell on your Windows Server.
- Download the Create Accounts Script
- Download the script from GitHub and extract it.
- Run the Script
- Navigate to the directory where the script is located using PowerShell.
- Execute the script to create user accounts:
.\CreateAccounts.ps1
- Verify User Creation
- Use the following command to list all users:
Get-ADUser -Filter *
Conclusion
You have successfully set up a basic home lab with Active Directory using Oracle VirtualBox. You installed Windows Server 2019, configured Active Directory, and created user accounts using PowerShell. This foundational knowledge is crucial for advancing in IT and cybersecurity. Next steps could include exploring group policies, setting up file services, or learning more about server management.