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¶
- Create a VM from the Windows Server 2022 image.
- Name the VM
VDI-DC. - Recommended specs: 4 vCPUs, 8 GB RAM, 100 GB disk.
- Record the VM's internal IP address — you will need it for DNS configuration.
Step 2: Install Active Directory Domain Services¶
- Open Server Manager.
- Click Manage → Add Roles and Features.
- Click Next until Server Roles.
- Select Active Directory Domain Services.
- Click Add Features when prompted.
- Click Next through the remaining screens and click Install.
- Wait for the installation to complete.
Step 3: Promote to Domain Controller¶
- In Server Manager, click the warning notification flag.
- 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:
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:
Verify the users and share were created correctly:
Quick Commands¶
Useful commands for checking Domain Controller state while troubleshooting:
Check domain and users:
Check DNS:
Check Remote Desktop is enabled:
Next steps¶
With the Domain Controller in place, continue to Creating a Golden Image to prepare a Windows VM template for VDI sessions.