Skip to content

Setting Up a Domain Controller

This section covers creating a Domain Controller VM that serves as the identity provider for your VDI environment. It's a prerequisite for Creating a Golden Image, and for using domain accounts to log in to VDI sessions.

Prerequisites

  • Windows Server 2022 image available in your location
  • A cloudspace with network access
  • Administrator access to the portal

Step 1: Create the Domain Controller VM

  1. Create a VM from the Windows Server 2022 image.
  2. Name the VM VDI-DC.
  3. Recommended specs: 4 vCPUs, 8 GB RAM, 100 GB disk.
  4. Record the VM's internal IP address — you will need it for DNS configuration.

Step 2: Install Active Directory Domain Services

  1. Open Server Manager.
  2. Click Manage → Add Roles and Features.
  3. Click Next until Server Roles.
  4. Select Active Directory Domain Services.
  5. Click Add Features when prompted.
  6. Click Next through the remaining screens and click Install.
  7. Wait for the installation to complete.

Step 3: Promote to Domain Controller

  1. In Server Manager, click the warning notification flag.
  2. Click Promote this server to a domain controller.

Deployment configuration:

  • Select Add a new forest.
  • Enter a domain name (e.g. corp.local).

Domain Controller Options:

  • Functional level: Windows Server 2016 or later.
  • Enable DNS server.
  • Enable Global Catalog.
  • Set a DSRM password and record it.

Paths: Leave defaults.

Click Install. The server will reboot automatically. Wait 5–10 minutes for the reboot to complete.

Step 4: Create Users

After the reboot, log in as CORP\Administrator (replace CORP with your NetBIOS domain name).

Create an Organizational Unit:

Import-Module ActiveDirectory
New-ADOrganizationalUnit -Name "VDI-Users" -Path "DC=corp,DC=local"

Create user accounts:

$password = ConvertTo-SecureString "TempPass123!" -AsPlainText -Force
foreach ($username in @("user1", "user2", "user3")) {
    New-ADUser -Name $username `
        -SamAccountName $username `
        -UserPrincipalName "$username@corp.local" `
        -Path "OU=VDI-Users,DC=corp,DC=local" `
        -AccountPassword $password `
        -Enabled $true `
        -PasswordNeverExpires $true
}

Tip

Replace corp.local with your actual domain name and use a strong password.

Set up roaming profiles, so user settings and files follow them between VDI sessions:

New-Item -ItemType Directory -Path "C:\Profiles" -Force
New-SmbShare -Name "Profiles$" -Path "C:\Profiles" -FullAccess "Everyone"

Then point each user's profile path at the share:

Set-ADUser -Identity $username -ProfilePath "\\$env:COMPUTERNAME\Profiles$\$username"

Verify the users and share were created correctly:

Get-ADUser -Filter * -SearchBase "OU=VDI-Users,DC=corp,DC=local"
Get-SmbShare -Name "Profiles$"

Quick Commands

Useful commands for checking Domain Controller state while troubleshooting:

Check domain and users:

Get-ADDomain
Get-ADUser -Filter * -SearchBase "OU=VDI-Users,DC=corp,DC=local"

Check DNS:

nslookup corp.local
Get-DnsClientServerAddress

Check Remote Desktop is enabled:

Get-ItemProperty 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections

Next steps

With the Domain Controller in place, continue to Creating a Golden Image to prepare a Windows VM template for VDI sessions.