Skip to content

Instantly share code, notes, and snippets.

@zimnyaa
Created February 14, 2022 14:31
Show Gist options
  • Save zimnyaa/b08d016e13163c52bc2cd7a42ebe9abb to your computer and use it in GitHub Desktop.
Save zimnyaa/b08d016e13163c52bc2cd7a42ebe9abb to your computer and use it in GitHub Desktop.
Simple AutomatedLab ADCS lab setup.
New-LabDefinition -Name Lab1CA1 -DefaultVirtualizationEngine Azure
$azureDefaultLocation = 'Australia East' # CHANGETHIS
Add-LabAzureSubscription -DefaultLocationName $azureDefaultLocation
#defining default parameter values, as these ones are the same for all the machines
$PSDefaultParameterValues = @{
'Add-LabMachineDefinition:DomainName' = 'contoso.com'
'Add-LabMachineDefinition:Memory' = 8GB
'Add-LabMachineDefinition:OperatingSystem' = 'Windows Server 2016 Datacenter (Desktop Experience)'
}
Add-LabMachineDefinition -Name DC1 -Roles RootDC
Add-LabMachineDefinition -Name CA1 -Roles CaRoot
Add-LabMachineDefinition -Name Client1 -OperatingSystem 'Windows 10 Enterprise'
Add-LabMachineDefinition -Name Client2 -OperatingSystem 'Windows 10 Enterprise'
Install-Lab
Enable-LabCertificateAutoenrollment -Computer -User -CodeSigning
# AV is optional
Invoke-LabCommand -ScriptBlock {Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))} -ComputerName Client2 -PassThru
Invoke-LabCommand -ScriptBlock {Set-ExecutionPolicy Bypass -Scope Process -Force; choco install kis -y -force} -ComputerName Client2 -PassThru
Show-LabDeploymentSummary -Detailed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment