UsingAutomatedLab

Following is how I set up my Active Directory Lab (one domain controller and one member server) in under 30 minutes with just a few lines of PowerShell code using the wonderful AutomatedLab module.

  1. Ensure you have Hyper-V set up on the host.
    Install necessitates a reboot. image

  2. Install the PowerShell module.
    Perform all of the steps in an elevated session.

Find-Module AutomatedLab | Install-Module
  1. Create and populate a new labsources folder
 New-LabSourcesFolder

This creates the necessary folder structure. image

  1. Copy your ISO files to the ISO directory (C:\LabSources\ISOs)
    I had issues with evaluation editions of the Operating Systems.

  2. Verify the ISOs (pay attention to the OperatingSystemName, you will use them shortly)

Get-LabAvailableOperatingSystem

image

  1. Create a lab definition
New-LabDefinition -Name ADTestLab -DefaultVirtualizationEngine HyperV

This does quite a few things including pulling in the SysInternals suite

  1. Add machines to our Lab Definition
$DomainController = @{
    Name            = 'DC01'
    Memory          = '1GB'
    OperatingSystem = 'Windows Server 2022 Standard (Desktop Experience)'
    Roles           = 'RootDC'
    DomainName      = 'FatBeard.com'
}
Add-LabMachineDefinition @DomainController

$server = @{
    Name            = 'Server01'
    Memory          = '1GB'
    OperatingSystem = 'Windows Server 2022 Standard (Desktop Experience)'
    DomainName      = 'FatBeard.com'
}
Add-LabMachineDefinition @Server
  1. Create the lab!
Install-Lab
# Take a break, you deserve it! Plus this takes a few minutes.
  1. You can get a high-level summary of what was created
    The default credentials are Administrator/Somepass1.
Show-LabDeploymentSummary -Detailed

image

  1. Open Hyper-V to verify image

  2. Want to connect to a machine from the commandline?

Connect-LabVM DC01
  1. Want to delete the lab?
Remove-Lab -Name <Name of Lab>