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.
-
Ensure you have Hyper-V set up on the host.
Install necessitates a reboot. -
Install the PowerShell module.
Perform all of the steps in an elevated session.
Find-Module AutomatedLab | Install-Module
- Create and populate a new labsources folder
New-LabSourcesFolder
This creates the necessary folder structure.
-
Copy your ISO files to the ISO directory (C:\LabSources\ISOs)
I had issues with evaluation editions of the Operating Systems. -
Verify the ISOs (pay attention to the OperatingSystemName, you will use them shortly)
Get-LabAvailableOperatingSystem
- Create a lab definition
New-LabDefinition -Name ADTestLab -DefaultVirtualizationEngine HyperV
This does quite a few things including pulling in the SysInternals suite
- 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
- Create the lab!
Install-Lab
# Take a break, you deserve it! Plus this takes a few minutes.
- You can get a high-level summary of what was created
The default credentials are Administrator/Somepass1.
Show-LabDeploymentSummary -Detailed
Connect-LabVM DC01
- Want to delete the lab?
Remove-Lab -Name <Name of Lab>