Skip to content

2.Setup Forest

2.1 Prerequisites

Hostname

Make sure you have the hostname of the server set to what you want. Changing hostnames on a domain controller can cause outage :)

Static IP

Set a static IP for the computer, refer to this guide

2.2 Install AD-Domain-Services

# Install AD PowerShell module
Install-WindowsFeature -Name AD-Domain-Services -IncludeManagementTools

2.3 Create Forest

Change the script values

Please note, you want to change the password, DomainName and DomainNetbiosName, before running the script.

$notepad SetupForest.ps1
## Might need to restart before running the command ##

Import-Module ADDSDeployment

$password = ConvertTo-SecureString -AsPlainText "<your-custom-password>" -Force

Install-ADDSForest `
-CreateDnsDelegation:$false `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "WinThreshold" `
-DomainName "iceindustrial.is" `
-DomainNetbiosName "ICEINDUSTRIAL" `
-ForestMode "WinThreshold" `
-InstallDns:$true `
-LogPath "C:\Windows\NTDS" `
-NoRebootOnCompletion:$false `
-SysvolPath "C:\Windows\SYSVOL" `
-SafeModeAdministratorPassword $password `
-Force:$true


# Install the Active Directory module
Install-WindowsFeature RSAT-AD-PowerShell

# List Domains in forest
Import-Module ActiveDirectory # Verify that Active Directory is installed for powershell
Get-ADForest | select domains 

2.4 Create shadow copies

# List shadows 
vssadmin list shadows

# Create a shadow for C drive
vssadmin create shadow /FOR=c:

# Now list shadows again 
vssadmin list shadows