AutomatedLab (AL) enables you to setup test and lab environments on Hyper-v or Azure with multiple products or just a single VM in a very short time. There are only two requirements you need to make sure: You need the DVD ISO images and a Hyper-V host or an Azure subscription.
Apart from the module itself your system needs to meet the following requirements:
There are two options installing AutomatedLab:
Installation
Raimund Andée [MSFT] edited this page on Feb 11, 2018 · 5 revisions
AutomatedLab (AL) is a bunch of PowerShell modules. For an easy installation, you can use the provided MSI or the PowerShell Gallery.
Download Link: https://github.com/AutomatedLab/AutomatedLab/releases
There are not many choices when installing AL.
The options Typical and Complete are actually doing the same and install AL to the default locations. The PowerShell modules go to “C:\Program Files\WindowsPowerShell\Modules”, the rest to “C:\LabSources”.
As LabSources can grow quite big, you should go for a custom installation and put this component on a disk with enough free space to store the ISO files. This disk does not have to be an SSD. Do not change the location of the modules unless you really know what you are doing.
Very important to AL is the LabSources folder that should look like this:
If all that worked you are ready to go for Getting Started.
AutomatedLab is provided on the PowerShell Gallery and updated on a regular basis. All the dependancies will be taken into account and some other modules are installed.
One important part of AutomatedLab is the LabSources folder that cannot be provided on the PowerShell Gallery. A new Cmdlet (New-LabSourcesFolder) has been introduced that downloads the AutomatedLab sources, extracts just the LabSources folder and puts it on the given drive.
There are only two commands that you need to run:
Install-Module -Name AutomatedLab -AllowClobber
New-LabSourcesFolder
Getting Started
Raimund Andée [MSFT] edited this page on Dec 23, 2017 · 16 revisions
After completed the Installation it is time to test installing the first lab fully automated.
Of course AutomatedLab (AL) cannot install an operating system without actually having the bits. Hence you need to download an ISO file from MSDN, TechNet Evaluation Center or somewhere else. These files need to go to your folder “ISOs” located in the “LabSoures” folder.
The “ISOs” folder contains only one file after the installation of AL: “_Put all ISO images in here.txt”. I have downloaded Windows Server 2016 from the TechNet Evaluation Center and put the file like shown below.
Testing the ISO files
To make sure that AL can read the file, try to get a list of available operating systems. Open an elevated PowerShell ISE and call the following command (make sure you point to the right location for the LabSources folder:
Get-LabAvailableOperatingSystem -Path E:\LabSources
This returns a list of all operating system images found on the ISO file (of course this works also if there are a bunch of different OS ISOS in the folder).
Install the first lab
Plesae open an elevated PowerShell ISE and create a new empty document (CTRL+N) if not already open.
Copy and paste the following lines into the ISE:
New-LabDefinition -Name GettingStarted -DefaultVirtualizationEngine HyperV
Add-LabMachineDefinition -Name FirstServer -OperatingSystem ‘Windows Server 2016 SERVERSTANDARD’
Install-Lab
Show-LabDeploymentSummary
The just press the run button or hit F5 to start the deployment.
This is what is going to happen. Many things happen automatically but can be customized:
I have uploaded the log of the deloyment. Your output should look pretty similar. In my case the deployment took about 10 minutes. It gets much faster if the base disk does already exist.
If you want to get rid of the lab, just call Remove-Lab. The cmdlet removes the VMs including the disks and the virtual switches. It dies not touch the base disks.
If you have closed the ISE in the meantime, either specify the lab name or import it first.
Summary
With AutomatedLab it is extremely easy to create various kinds of labs. The more you define your lab by code, the easier it is to re-deploy it and the less time you invest in the long term.
If you like what you have seen, take a look at the folder “LabSources\Sample Scripts\Introduction”. These scripts demo how to create domains, internet facing labs, PKI, etc.
Please provide feedback if something does not work as expected. If you are missing a feature or have some great ideas, please open an issue.
Supported products
This solution supports setting up virtual machines with the following products
shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…
Extract and execute a PE embedded within a PNG file using an LNK file. The…
Embark on the journey of becoming a certified Red Team professional with our definitive guide.…
This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…
This took me like 4 days (+2 days for an update), but I got it…
MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…