Skip to content

Setting up a Domain connected to your machine

1. Resolve conflicting SID's

It is likely that the SIDs are the same for the Domain Controller and the current-working-VM. To resolve this, follow these steps:

a. Navigate to the Sysprep directory: C:\Windows\System32\Sysprep

b. Run Sysprep

c. In the Sysprep window, ensure the Generalize checkbox is checked.

d. Press OK

e. The machine will now restart

f. Connect via Proxmox and finish setup

image

2. Install AD-Domain-Services

# Install AD tools
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools

3. Rename the machine

Rename your local machine

4. Set a static IP and set the DNS of the machine that is hosting the forest

Setup Static IP and configure network

4.1 [conditional] If something went wrong with previous step

Reset internet settings and re-enable DHCP to generate a new IP

After running this PowerShell script, feel free to retry the previous step

netsh int ip reset
ipconfig /release
ipconfig /renew
ipconfig /flushdns
netsh winsock reset
$interface = "Ethernet"
Get-NetAdapter -Name "Ethernet" | Disable-NetAdapter -Confirm:$false
Get-NetAdapter -Name "Ethernet" | Enable-NetAdapter -Confirm:$false
Set-NetIPInterface -InterfaceAlias $interface -Dhcp Disabled
Set-NetIPInterface -InterfaceAlias $interface -Dhcp Enabled

5. Install Domain on the machine

The powershell command

# Predefine the DSRM password
$dsrmPassword = "<custom-password>" | ConvertTo-SecureString -AsPlainText -Force

# Predefine the password for the credentials
$password = "<forest-user-password>" | ConvertTo-SecureString -AsPlainText -Force

# Create the credential object
$credential = New-Object System.Management.Automation.PSCredential ("<forest-username>@<forest-domain>", $password)
# Example
# $credential = New-Object System.Management.Automation.PSCredential ("administrator@iceindustrial.is", $password)

# Import the ADDSDeployment module
Import-Module ADDSDeployment

# Install the ADDS Domain with predefined credentials and DSRM password
Install-ADDSDomain `
-NoGlobalCatalog:$false `
-CreateDnsDelegation:$true `
-Credential $credential `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "WinThreshold" `
-DomainType "ChildDomain" `
-InstallDns:$true `
-LogPath "C:\Windows\NTDS" `
-NewDomainName "<domain-name>" `
-NewDomainNetbiosName "<DOMAIN-NAME>" `
-ParentDomainName "<forest-domain>" `
-NoRebootOnCompletion:$false `
-SafeModeAdministratorPassword $dsrmPassword `
-SiteName "Default-First-Site-Name" `
-SysvolPath "C:\Windows\SYSVOL" `
-Force:$true