Back to PESK.co.uk

How to create your Windows Server Hyper-V Lab using the GUI and Windows PowerShell.

This Hyper-V lab should be suitable for the MCSA: Windows Server 2012 courses, M20410, M20411 and M20412, as well as for learning/testing multiple technologies in Windows Server 2012 R2 and Windows Server 2016.

Disclaimer: While all the steps here have been tested to work, some additional troubleshooting and tweaking may be necessary. The information provided here is given in good faith.

Hardware:The following physical hardware is recommended as a minimum. Any less than this will require you to adjust the virtual machine specifications down:

Prerequisites:

If you're in a hurry or you've done all this before, click here to go straight to the PowerShell code.



STEP 1: Get your own ISOs you filthy animal…!

Download Windows Server 2016 Datacenter Evaluation

  1. Open your favourite browser and in your favourite search engine, search for “intitle:Try Windows Server 2016”.
  2. Select the option for Windows Server Free Trial | Microsoft. Make sure to select the Windows Server 2016 on-premises 'Download free trial' link and register. Then download and save the 64-bit ISO locally (We’ll assume C:\ISO\WS2016EntEval.ISO).
  3. Download Windows 10 Enterprise Evaluation

  4. From the same link as above (Microsoft Evaluation Center), at the top of the page, click on the Products button and in the drop-down, select Windows 10 Enterprise.
  5. Jump through the relevant hoops and save the ISO locally (We’ll assume C:\ISO\Win10EntEval.ISO).

  Skip the next several pages and go straight to the PowerShell code...

STEP 2: Get your Networking on…

Create some Layer 2 switches for the Virtual Machines to connect to using the Hyper-V Virtual Switch Manager.

  1. Click on START and type Hyper-V. Right-click on Hyper-V Manager and select Pin to Start, right-click on Hyper-V Manager again and select Pin to Taskbar.
  2. Now open Hyper-V Manager. Click on Virtual Switch Manager.
  3. With New virtual network switch selected, under Create virtual switch and What type of virtual switch do you want to create? Select Private and beneath that, click on Create Virtual Switch.
  4. Name the virtual switch Private Network and under Connection type and What do you want to connect this virtual network to? make sure that Private Network is selected.
  5. Repeat steps 3 and 4, naming the second virtual switch Private Network 2.

  Did I mention that you can skip the next several pages and do all this in PowerShell...?

STEP 3: Virtual Machine creation…

Now let’s create some Virtual Machines (VMs). The following virtual machines (highlighted in red) will need to be created, all the rest are optional;


You may need to adjust the specifications to meet your own individual resources and requirements.

  1. In Hyper-V Manager, on the Actions pane on the right-hand side, click on New and select Virtual Machine.

  2. Click Next on the Before You Begin screen and on the Specify Name and Location screen, type LON-DC1 as the name of the virtual machine (VM).
  3. Enable the checkbox next to Store the virtual machine in a different location and select a suitable location.
    This will typically be a fast drive (SSDs are recommended), with enough space and can be backed up easily. Click Next.
  4. On the Specify Generation screen, leave Generation 1 selected as default and click Next.
  5. On the Assign Memory screen, type in 2048 and make sure that the Use Dynamic Memory for this virtual machine. checkbox is selected. Click Next.
  6. On the Configure Networking screen, select Private Network from the Connection drop-down box and click Next. (THIS IS NIC 1!)
  7. On the Connect Virtual Hard Disk screen, leave the Name and Location as default, change the size to 30GB (or higher, if you can afford it, or as per specifications above).
    Click Next.
  8. On the Installation Options screen, select the Install an operating system from a bootable CD/DVD-ROM option and select the Image file (.iso) radio button and Browse to
    C:\ISO\WS2016EntEval.ISO. Click Next. Review the Summary, and click Finish.
  9. Repeat the steps for all VMs, making the changes necessary according to the specifications above, before starting any of the VMs.
  10. Once all the VMs have been created, click once on the LON-DC1 VM, click on Settings in the Actions pane, and make the following changes (depending on your computer specification,
    some may not be possible);
    1. Under Add Hardware, select Network Adapter, click Add and on the Network Adapter pane, under Virtual switch, select Private Network 2 from the drop-down box.
      (NOTE! You will have repeat this step (10.a) for LON-SVR1 and LON-SVR2. These NICs will later be renamed to "1.Internal" and "2.External".) (THIS IS NIC 2!)
    2. Under the Memory section, change the RAM and Dynamic Memory settings as per the specifications above.
    3. Change the Number of virtual processors: 4
  11. Select and copy the text of the location of the existing hard disk up to the Virtual Machines text, thus; G:\HVVM\LON-DC1\VirtualHard Disks\
  12. For LON-DC1, LON-SVR1 and LON-SVR2 VMs, add a second, 10GB HDD to IDE Controller 0.
    1. In the Settings page of each VM (these can be selected using the green left/right arrows on the top bar or via the drop-down bar that bears the VM name), click on IDE Controller 0,
      and on the right-hand pane, make sure Hard Drive is selected and click on Add.
    2. In the new Hard Drive window, under Virtual Hard Disk, click on New.
    3. Click Next on the Before You Begin screen. Click Next.
    4. Make sure VHDX is selected in the Choose Disk Format screen. Click Next.
    5. In the Choose Disk Size screen, select Fixed size. Click Next.
    6. In the Specify Name and Location screen, next to Name: type in LON-DC1-Allfiles.vhdx and next to Location: paste the location that you copied in step 11, or locate the location
      of the existing hard disk (e.g., G:\HVVM\LON-DC1\Virtual Hard Disks\LON-DC1.vhdx) and copy the text up to the trailing backslash after Virtual Disks
      (e.g., G:\HVVM\LON-DC1\Virtual Hard Disks\).
    7. Download the following three files:
      LON-DC1-2.zip        SHA256: 6cda1105ea2619711054d640b7c065feadee7c2c347597e62cd05480989a3dea
      LON-SVR1-2.zip     SHA256: 5ef5efaf962afa2fac740de31b8dadf43b69dfd27111b4d86d9fa1d304be7b2d
      LON-SVR2-2.zip     SHA256: afd3671b49c1d8bf9470bdaf966401a0cc61112f2a494cd245d27da8e1d0391f

      Unzip the files and copy the contents of LON-DC1-2.zip to the LON-DC1 second hard disk, LON-SVR1-2.zip to the LON-SVR1 second hard disk and LON-SVR2-2.zip to the LON-SVR2
      second hard disk.


For the love of all that is holy... do all this in PowerShell...!!

STEP 4: Virtual Machine Installation…

Now we can start installing OSes and configuring the Virtual Machines.

  1. Right-click the LON-DC1 virtual machine in the center pane and select Connect, or highlight the VM and in the Actions pane, click on Connect.
  2. On the menu bar, click on Media, expand DVD Drive and select Insert Disk… Browse to the relevant ISO, click on it and then click on Start inside the VM. Windows installation should start.
  3. For Language to install: Select any language, as long as it’s English (United States), however, for Time and Currency format: select English (United Kingdom).
  4. Click Next, then on the next screen, Install Now.
  5. On the Activate Windows screen, click on I don't have a product key.
  6. In the Select the operating system you want to install window, make sure to select Windows Server 2016 Datacenter (Desktop Experience).
  7. Continue with LON-DC1 installation.
  8. If you wish, you may now start installing the other VMs, but note that multiple, simultaneous installations will undoubtedly, negatively impact host computer resources, especially where they are limited.

  9. Once the installation completes, the VM will restart and you may now repeat step 2 above and select Eject.
  10. Upon restart use the credentials below and click on Finish.
  11. Username:    Administrator
    Password:     Pa55w.rd



STEP 5: Windows Server Virtual Machine Configuration…

First things, first. We’ll perform post-installation configuration and the install some key roles.

  1. Log onto LON-DC1 using the username; Administrator and the password; Pa55w.rd.
    Once logged in, when Server Manager opens, click on Configure this local server and then click on the randomly generated computer name (e.g. WIN-EMQF28R2OCP).
  2. The System Properties dialog screen open. Under Computer Name, in the Computer description: field, type in LON-DC1 and then below that, click on Change...
  3. In the Computer name: field, type in LON-DC1 and then click on OK.
  4. Click OK in the Computer Name/Domain Changes popup dialog. Click Close in the System Properties window. When the restart popup appears, select Restart Later.
  5. Back in Server Manager, click on Configure this local server and click on the IPv4 address assigned by DHCP, IPv6 enabled link next to Ethernet.
  6. Right-click the first Ethernet NIC, select Rename and rename it to 1.Internal. Right-click the second NIC, and rename it to 2.External.
    (NOTE! You will have repeat this step (6) for LON-SVR1 and LON-SVR2.
  7. Right-click the 1.Internal NIC, select Properties, then Internet Protocol Version 4 (TCP/IPv4).
  8. Enter the appropriate IP settings. Take special note of DNS settings.

    The 1.Internal NICs on LON-DC1, LON-SVR1 and LON-SVR2 will have the following IP settings:

  9.   LON-DC1 LON-SVR1 LON-SVR2
    IP: 172.16.0.10 172.16.0.21 172.16.0.22
    SM: 255.255.0.0 255.255.0.0 255.255.0.0
    Pri DNS: 172.16.0.10 172.16.0.10 172.16.0.10
    Sec DNS: 127.0.0.1 Blank Blank

  10. The 2.External NICs on LON-DC1, LON-SVR1 and LON-SVR2 will have the following IP settings (All other entries may be left blank.):
  11.   LON-DC1 LON-SVR1 LON-SVR2
    IP: 131.107.0.1 131.107.0.21 131.107.0.22
    SM: 255.255.0.0 255.255.0.0 255.255.0.0

  12. Click OK then Close.
    NOW, go back to the 1.Internal NIC and check those DNS settings I told you about... Once ales ist gut, Click OK then Close.

    HINT! To identify which NIC is connected to the (Internal) “Private Network”, in Hyper-V Manager, select the LON-DC1 VM, click on Settings and click on one of Network Adapter and under Virtual switch choose Not connected. The corresponding NIC in the VM should respond with Network cable unplugged.

  13. Now restart the VM.
  14. Once restarted, go back into the NIC settings and verify that the DNS settings have not changed.



STEP 6: Promote the Server to a Domain Controller…

Now we'll go ahead and complete the promotion of LON-DC1 to a domain controller.

  1. In Server Manager, the notification icon should be showing a red flag. One of the notifications should be a link to Promote this server to a domain controller. Click on this link.
  2. The Active Directory Domain Services Configuration Wizard opens.
  3. Select Add a new forest and type Adatum.com for the Root domain name: Click Next.
  4. In the Domain Controller Options screen, type Pa$$w0rd as the Domain Services Restore Mode (DSRM) password.
  5. Click Next to ignore the warning in the DNS Options screen.
  6. Click Next all the way to the end and start the installation, after making sure that All prerequisite checks passed successfully.
  7. Once the DC has been installed, Configure DNS
    1. Click on Tools and open the DNS Manager.
    2. Expand Forward Lookup Zones, right-click on Adatum.com, and create the following resource records;
    3.                                        
      Record Value Record Type
      adfs172.16.0.10 Host (A)
      crl lon-dc1.adatum.com Alias (CNAME)
      EnterpriseRegistration lon-svr1.adatum.com Alias (CNAME)

  8. Next up, we'll configure DHCP.
    1. Click on Tools and then DHCP Manager.
    2. First and foremost, right-click on lon-dc1.adatum.com and click on Authorize then click on the refresh icon on the toolbar.
    3. Expand lon-dc1.adatum.com, expand IPv4, and create the following Scope;
    4. Name:Adatum.com
      Address Pool: Start IP: 172.16.0.160
      End IP:  172.16.0.190


      Scope Options: 003 Router 172.16.0.1
      006 DNS Server 172.16.0.10
      015 Domain Name Adatum.com

  9. Once that is done, we'll start configuring Active Directory Certificate Services (ADCS) on LON-DC1.
    1. Click on the notification icon and open the Configure Active Directory Certificate Services on the destination computer link. Click Next on the Credentials page.
    2. Select Certification Authority and Certification Authority Web Enrollment on the Role Services page.
    3. On the Setup Type screen, make sure that Enterprise CA is selected and on the CA Type page, Root CA is selected.
    4. On the Private Key page, click Next and on the Cryptography screen, change the Key length: to 4096 and select the option to Allow administrator interaction…
    5. Click Next and on the CA Name page, change the Common name for this CA: to AdatumCA
    6. Accept all other defaults and install Certificate Services.
    7. IMPORTANT...

    8. NOTE! When installing LON-CA1, make sure that on step c., the Setup Type is Standalone and CA Type is Root CA and on step e., the Common name for this CA: is set to AdatumRootCA.




    PowerShell BABY!

    Next, let’s see how to do all that using Windows PowerShell…
        In half the time! Power’s Hell!
            AmIright, amIright!?

    Note: Most issues will arise from either:
    (a) You're not running PowerShell as Administrator.
    (Right-click on PowerShell and Run as Administrator)
    (b) Your ExecutionPolicy is set to Restricted.
    (Run the cmdlet: Set-ExecutionPolicy RemoteSigned).

    If you are using Windows Server 2012 R2 or 2016 as the physical virtualisation host, run the following cmdlet first;

    Install-WindowsFeature Hyper-V-Tools,Hyper-V-PowerShell

    But, let's not fight...
    A script, you say...? Scroll to the bottom...

    To speed things up, you can copy and paste all the cmdlets into PowerShell...

    STEP 1: Grab some ISOs

    Make sure you have performed Step 1 and grabbed some ISOs and placed them in the $Path location. In our case, $Path = C:\ISO.

    You don't need PowerShell for this, but say that you did (I don't know how long these links will last...):

    For Windows Server 2016 Datacenter:
    Invoke-WebRequest -UseBasicParsing -URI https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO -Method GET -OutFile C:\ISO\WS2016EntEval.iso
    For Windows 10 Enterprise:
    Invoke-WebRequest -UseBasicParsing -URI https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso -Method GET -OutFile C:\ISO\Win10EntEval.iso

    STEP 2: Configure OSI Layer-2 Networking

    Create Virtual Switches;

    New-VMSwitch -SwitchName 'Private Network' -SwitchType Private
    New-VMSwitch -SwitchName 'Private Network 2' -SwitchType Private

    STEP 3: Create Virtual Machines

    Set-Location "C:\" -ErrorAction SilentlyContinue
    New-Item -ItemType Directory -Name HVVM -ErrorAction SilentlyContinue
    New-VM -Name LON-DC1 -Path ($Path+'LON-DC1') -MemoryStartupBytes 2GB -NewVHDPath ($Path+'LON-DC1\Virtual Disks\LON-DC1.vhdx') -NewVHDSizeBytes 30GB -SwitchName 'Private Network' -Generation 1
    New-VM -Name LON-SVR1 -Path ($Path+'LON-SVR1') -MemoryStartupBytes 2GB -NewVHDPath ($Path+'LON-SVR1\Virtual Disks\LON-SVR1.vhdx') -NewVHDSizeBytes 30GB -SwitchName 'Private Network' -Generation 1
    New-VM -Name LON-CL1 -Path ($Path+'LON--CL1 -MemoryStartupBytes 2GB -NewVHDPath ($Path+'LON-CL1\Virtual Disks\LON-CL1.vhdx') -NewVHDSizeBytes 20GB -SwitchName 'Private Network' -Generation 1
               OPTIONAL:
               New-VM -Name LON-SVR2 -Path ($Path+'LON-SVR2') -MemoryStartupBytes 2GB -NewVHDPath ($Path+'LON-SVR2\Virtual Disks\LON-SVR2.vhdx') -NewVHDSizeBytes 30GB -SwitchName 'Private Network' -Generation 1
               New-VM -Name LON-SVR3 -Path ($Path+'LON-SVR3') -MemoryStartupBytes 1GB -NewVHDPath ($Path+'LON-SVR3\Virtual Disks\LON-SVR3.vhdx') -NewVHDSizeBytes 30GB -SwitchName 'Private Network' -Generation 1
               New-VM -Name LON-SVR4 -Path ($Path+'LON-SVR4') -MemoryStartupBytes 1GB -NewVHDPath ($Path+'LON-SVR4\Virtual Disks\LON-SVR4.vhdx') -NewVHDSizeBytes 30GB -SwitchName 'Private Network' -Generation 1
               New-VM -Name LON-CA1 -Path ($Path+'LON-CA1') -MemoryStartupBytes 1GB -NewVHDPath ($Path+'LON-CA1\Virtual Disks\LON-CA1.vhdx') -NewVHDSizeBytes 30GB -SwitchName 'Private Network' -Generation 1
               OPTIONAL:

    Create second hard drives for LON-DC1, LON-SVR1 and LON-SVR2 and attach them;

    New-VHD -Path ($Path+'LON-DC1\Virtual Disks\LON-DC1-AllFiles.vhdx') -SizeBytes 10GB -Fixed
    New-VHD -Path ($Path+'LON-SVR1\Virtual Disks\LON-SVR1-AllFiles.vhdx') -SizeBytes 10GB -Fixed
    New-VHD -Path ($Path+'LON-SVR2\Virtual Disks\LON-SVR2-AllFiles.vhdx') -SizeBytes 10GB -Fixed

    Configure Processors;

    Set-VMProcessor -VMName LON-DC1 -Count 4
    Set-VMProcessor -VMName LON-SVR1 -Count 4
    Set-VMProcessor -VMName LON-CL1 -Count 4
               OPTIONAL:
               Set-VMProcessor -VMName 'LON-SVR2' -Count 4
               Set-VMProcessor -VMName 'LON-SVR3' -Count 2
               Set-VMProcessor -VMName 'LON-SVR4' -Count 2
               Set-VMProcessor -VMName 'LON-CA1' -Count 2
               OPTIONAL:

    Configure Virtual Machines to start from DVD (.iso);

    Set-VMDVDDrive -VMName 'LON-DC1' -Path 'C:\ISO\WS2016EntEval.ISO'
    Set-VMDVDDrive -VMName 'LON-SVR1' -Path 'C:\ISO\WS2016EntEval.ISO'
    Set-VMDVDDrive -VMName 'LON-CL1' -Path 'C:\ISO\Win10EntEval.ISO'
               OPTIONAL:
               Set-VMDVDDrive -VMName 'LON-SVR2' -Path 'C:\ISO\WS2016EntEval.ISO'
               Set-VMDVDDrive -VMName 'LON-SVR3' -Path 'C:\ISO\WS2016EntEval.ISO'
               Set-VMDVDDrive -VMName 'LON-SVR4' -Path 'C:\ISO\WS2016EntEval.ISO'
               Set-VMDVDDrive -VMName 'LON-CA1' -Path 'C:\ISO\WS2016EntEval.ISO'
               OPTIONAL:

    STEP 4: Now start the Virtual Machines and install Windows. You don't need PowerShell for that!

    But, say that you wanted to...

    Start-VM -Name 'LON-DC1','LON-SVR1','LON-CL1'
               OPTIONAL:
               Start-VM -Name 'LON-SVR2','LON-SVR3','LON-SVR4'
               OPTIONAL:

    Verify that the VMs are running:

    Get-VM | Where Status -eq 'Running'

    Change the computer names. From the physical virtualisation host...

    First, commit to memory (variables), local and domain credentials, for use throughout...

    $Cred1 = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList 'Administrator',('Pa55w.rd' | ConvertTo-SecureString -AsPlainText -Force)
    $Cred2 = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList 'ADATUM\Administrator',('Pa55w.rd' | ConvertTo-SecureString -AsPlainText -Force)

    Invoke-Command -VMName 'LON-DC1' -ScriptBlock{Rename-Computer -NewName 'LON-DC1' -LocalCredential $Cred1 -Force -Restart}
    Invoke-Command -VMName 'LON-SVR1' -ScriptBlock{Rename-Computer -NewName 'LON-SVR1' -LocalCredential $Cred1 -Force -Restart}
    Invoke-Command -VMName 'LON-CL1' -ScriptBlock{Rename-Computer -NewName 'LON-CL1' -LocalCredential $Cred1 -Force -Restart}
               OPTIONAL:
               Invoke-Command -VMName 'LON-SVR2' -ScriptBlock{Rename-Computer -NewName 'LON-SVR2' -LocalCredential $Cred1 -Force -Restart}
               Invoke-Command -VMName 'LON-SVR3' -ScriptBlock{Rename-Computer -NewName 'LON-SVR3' -LocalCredential $Cred1 -Force -Restart}
               Invoke-Command -VMName 'LON-SVR4' -ScriptBlock{Rename-Computer -NewName 'LON-SVR4' -LocalCredential $Cred1 -Force -Restart}
               Invoke-Command -VMName 'LON-CA1' -ScriptBlock{Rename-Computer -NewName 'LON-CA1' -LocalCredential $Cred1 -Force -Restart}
               OPTIONAL:

    STEP 5: Configure Windows IP and Networking settings. Again, PowerShell, no!

    But, again, say that you wanted to...

    First, get the NIC interface index number.
    $IfIndex = Invoke-Command -VMName 'LON-DC1' -Credential $Cred1 -ScriptBlock {Get-NetAdapter | Select -ExpandProperty IfIndex} | Select -First 1
    Then set the IP address...
    Invoke-Command -VMName 'LON-DC1' -Credential $Cred1 -ScriptBlock {Set-NetIPAddress -InterfaceIndex $ifindex -IPAddress 172.16.0.10 -PrefixLength 24}

    Clear the variable for reuse. Wash, Rinse, Repeat...
    Clear-Variable -Name IfIndex
    $IfIndex = Invoke-Command -VMName 'LON-SVR1' -Credential $Cred1 -ScriptBlock {Get-NetAdapter | Select -ExpandProperty IfIndex} | Select -First 1
    Invoke-Command -VMName 'LON-SVR1' -Credential $Cred1 -ScriptBlock {Set-NetIPAddress -InterfaceIndex $ifindex -IPAddress 172.16.0.21 -PrefixLength 24}

    Clear-Variable -Name IfIndex
    $IfIndex = Invoke-Command -VMName 'LON-CL1' -Credential $Cred1 -ScriptBlock {Get-NetAdapter | Select -ExpandProperty IfIndex} | Select -First 1
    Invoke-Command -VMName 'LON-CL1' -Credential $Cred1 -ScriptBlock {Set-NetIPAddress -InterfaceIndex $ifindex -IPAddress 172.16.0.50 -PrefixLength 24}

    STEP 6: Install AD Domain Services, Promote DC, Configure DNS and DHCP.

    Perfect use-case scenario for PowerShell...

    Invoke-Command -VMName 'LON-DC1' -Credential $Cred1 -ScriptBlock {Install-WindowsFeature 'AD-Domain-Services','DNS','DHCP' -IncludeAllSubFeature -IncludeManagementTools}

    And now the moment you've been waiting for...
    Install the Forest and Promote server to a domain controller.

    Invoke-Command -VMName 'LON-DC1' -Credential $Cred1 -ScriptBlock {Import-Module ADDSDeployment}
    Invoke-Command -VMName 'LON-DC1' -Credential $Cred1 -ScriptBlock {Install-ADDSForest -CreateDNSDelegation:$false -DatabasePath 'C:\Windows\NTDS' -DomainMode Win2012R2 -DomainName Adatum.com -DomainNetbiosName ADATUM -ForestMode Win2012R2 -LogPath C:\Windows\NTDS -NoRebootOnCompletion:$True -SysvolPath C:\Windows\SYSVOL -SafeModeAdministratorPassword (ConvertTo-SecureString "Pa55w.rd" -AsPlainText -Force) -Force:$true}

    Create DNS Resource Records;

    Add-DNSServerResourceRecordA -Name adfs -ZoneName adatum.com -IPv4Address 172.16.0.10 -TimeToLive 01:00:00
    Add-DNSServerResourceRecordCNAME -Name crl -HostNameAlias lon-dc1.adatum.com -ZoneName adatum.com
    Add-DNSServerResourceRecordCNAME -Name EnterpriseRegistration -HostNameAlias lon-svr1.adatum.com -ZoneName adatum.com

    Authorize the DHCP Server, create the DHCP Scope and set DHCP Scope Options;

    Add-DHCPServerInDC
    Add-DHCPServerv4Scope -StartRange 172.16.0.160 -EndRange 172.16.0.190 -SubnetMask 255.255.0.0 -Name Adatum -Type Both
    Set-DHCPServerv4OptionValue -ScopeID 172.16.0.0 -DNSDomain Adatum.com -DNSServer 172.16.0.10 -Router 172.16.0.1

      RELEASE THE KRAKEN!  
       Restart the Domain Controller…
    Restart-Computer LON-DC1 -Force

    Once the server completes the installation and reboots automatically, you may now start the configuration of the other VMs.

    The following cmdlets will allow you to add the hosts to the Adatum.com domain.

    Add all other virtual machines to the domain:

    Add-Computer -Computername LON-SVR1,LON-CL1 -DomainName Adatum.com –Credential $Cred2 -Restart –Force
               OPTIONAL:
               Add-Computer -Computername LON-SVR2,LON-SVR3,LON-SVR4 -DomainName Adatum.com –Credential $Cred2 -Restart –Force
               OPTIONAL:

     

    ADDENDUM

    NOTE! All hosts are members of the Adatum.com domain, EXCEPT LON-CA1, which is a Standalone Root CA and SHOULD NEVER be connected to the domain!

    IP Configuration: (Subnet Mask: 255.255.0.0; DNS: 172.16.0.10)


    LON-DC1: IP Address: 172.16.0.10; (Note! Primary DNS is ITSELF. Secondary is 127.0.0.1)
    This is the Domain Controller, Enterprise Root CA and hosts the Adatum.com domain.
    LON-CA1: IP Address: 172.16.0.25; This is a Member Server and Standalone Root CA (Not in the Domain!)
    LON-SVR1: IP Address: 172.16.0.21; This is a Member Server in the Adatum.com domain.
    LON-SVR2: IP Address: 172.16.0.22; This is a Member Server in the Adatum.com domain.
    LON-SVR3: IP Address: 172.16.0.23; This is a Member Server in the Adatum.com domain.
    LON-SVR4: IP Address: 172.16.0.24; This is a Member Server in the Adatum.com domain.
    LON-CL1: IP Address: 172.16.0.50; This is a Member Client in the Adatum.com domain.

    Once completed, and NOT BEFORE, install AD Certificate Services on LON-DC1;

    Install-WindowsFeature ADCS-Cert-Authority,ADCS-Web-Enrollment -IncludeAllSubFeature -IncludeManagementTools

    Configure Active Directory Certificate Services
    On LON-DC1;

    Install-ADCSCertificationAuthority -CAType EnterpriseRootCA -CryptoProviderName "RSA#Microsoft Software Key Storage Provider" -KeyLength 4096 -HashAlgorithmName SHA1 -CACommonName AdatumCA -AllowAdministratorInteraction -ValidityPeriod Years -ValidityPeriodUnits 5

    On LON-CA1;
    Install-ADCSCertificationAuthority -CAType StandAloneRootCA -CryptoProviderName "RSA#Microsoft Software Key Storage Provider" -KeyLength 4096 -HashAlgorithmName SHA1 -CACommonName AdatumRootCA -AllowAdministratorInteraction -ValidityPeriod Years -ValidityPeriodUnits 5

     
    Ah, yes. The script...


         Right-click, Save link As (or Save target as)...     CreateYourHyperVLab.ps1

         Verify the HASH signatures...

    MAC3DES: 1FEB05250CEE6296
    RIPEMD160: 28C96D32626122B08A8A38602960BABB8091F0C9
    SHA256: 3F3F468C523937049F35BBB1740EF32D45DFBBCAC66F6C0B15AB08AB5284C2D6
    SHA384: 535F1FE22938A86502721C418524196AFFF73DEC40B49F448E646C3FBFF6AF0639A9B4D6062B528184A2517F1E1C3935

    Just save it on your desktop and from the run dialog box:
    PowerShell %Userprofile%\Desktop\CreateYourHyperVLab.ps1

     

    Enjoy your newly minted lab!

     

    To the Surface...