Skip to content

Instantly share code, notes, and snippets.

@bill-long
Last active July 15, 2021 15:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bill-long/0226bdcd598b393659bc0db2c6ad8419 to your computer and use it in GitHub Desktop.
Save bill-long/0226bdcd598b393659bc0db2c6ad8419 to your computer and use it in GitHub Desktop.
$prefix = "LAB1"
New-LabDefinition -Name $prefix -DefaultVirtualizationEngine HyperV -ReferenceDiskSizeInGB 100 -VMPath "E:\VMs"
$e15role = Get-LabPostInstallationActivity -CustomRole Exchange2013 -Properties @{ OrganizationName = 'First Organization' }
$e16role = Get-LabPostInstallationActivity -CustomRole Exchange2016 -Properties @{ OrganizationName = 'First Organization' }
$e19role = Get-LabPostInstallationActivity -CustomRole Exchange2019 -Properties @{ OrganizationName = 'First Organization' }
Add-LabMachineDefinition -Name "$($prefix)DC1" -OperatingSystem 'Windows Server 2016 Standard (Desktop Experience)' -MinMemory 2GB -Memory 2GB -MaxMemory 8GB -Processors 4 -DomainName "$($prefix.ToLower()).local" -Roles RootDC
Add-LabMachineDefinition -Name "$($prefix)E15" -OperatingSystem 'Windows Server 2012 R2 Standard (Server with a GUI)' -Memory 8GB -Processors 8 -DomainName "$($prefix.ToLower()).local" -PostInstallationActivity $e15role
Add-LabMachineDefinition -Name "$($prefix)E16" -OperatingSystem 'Windows Server 2016 Standard (Desktop Experience)' -Memory 8GB -Processors 8 -DomainName "$($prefix.ToLower()).local" -PostInstallationActivity $e16role
Add-LabMachineDefinition -Name "$($prefix)E19" -OperatingSystem 'Windows Server 2019 Standard (Desktop Experience)' -Memory 8GB -Processors 8 -DomainName "$($prefix.ToLower()).local" -PostInstallationActivity $e19role
Add-LabMachineDefinition -Name "$($prefix)WK1" -OperatingSystem 'Windows 10 Enterprise' -MinMemory 2GB -Memory 2GB -MaxMemory 8GB -Processors 4 -DomainName "$($prefix.ToLower()).local"
Install-Lab -NetworkSwitches -BaseImages -VMs -Domains -StartRemainingMachines
Invoke-LabCommand -ComputerName "$($prefix)E15" -PostInstallationActivity
Invoke-LabCommand -ComputerName "$($prefix)E16" -PostInstallationActivity
Invoke-LabCommand -ComputerName "$($prefix)E19" -PostInstallationActivity
Show-LabDeploymentSummary -Detailed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment