Automated lab helps in setting up experimental lab environments quickly. The link  provides comprehensive guide and several sample scenario scripts are provided to help one get started.

To set up a simple Lab for development purposes the following script can be used.

New-LabDefinition -Name iDynamicsDev -ReferenceDiskSizeInGB 100 -Path ‘C:\iDynamics\Dev’ -DefaultVirtualizationEngine HyperV

Add-LabVirtualNetworkDefinition -Name Lab0
Add-LabVirtualNetworkDefinition -Name ‘Default Switch’ -HyperVProperties @{ SwitchType = ‘Default Switch’; AdapterName = ‘Wi-Fi’ }

Add-LabMachineDefinition -Name DC1 -Memory 2GB -OperatingSystem ‘Windows Server 2016 Datacenter (Desktop Experience)’ -Roles RootDC -Network Lab0 -DomainName

$netAdapter = @()
$netAdapter += New-LabNetworkAdapterDefinition -VirtualSwitch Lab0
$netAdapter += New-LabNetworkAdapterDefinition -VirtualSwitch ‘Default Switch’ -UseDhcp
Add-LabMachineDefinition -Name Router1 -Memory 2GB -OperatingSystem ‘Windows Server 2016 Datacenter (Desktop Experience)’ -Roles Routing -NetworkAdapter $netAdapter -DomainName

Add-LabMachineDefinition -Name Client1 -Memory 6GB -Network Lab0 -OperatingSystem ‘Windows Server 2016 Datacenter (Desktop Experience)’ -DomainName


Show-LabDeploymentSummary -Detailed

The above script will create three VM’s


  1. DC1 > Domain controller with domain name
  2. Router1 > joined to domain and having access to internet
  3. Client1 > joined to domain but with no internet access.

The definition files are stored as xml files at C:\idynamics\dev and the file Lab.xml will have all information relating to the LabDefinition iDynamicsDev. 

The cmdLet Import-Lab -Path C:\idynamics\dev\Lab.xml will indicate how may VM’s are hosted in HyperV


Removing the Lab is done by invoking the cmdLet Remove-Lab



Result of successfully removing the lab:

  1. C:\AutomatedLab-VMs will have only the base image
  2. C:\idynamics\dev and the associated config files will be removed