I am sure this could also be accomplished with Microsoft Hyper-V or another virtualisation platform. But I am currently using VMware and then also in this case.
This start as a very simple description of the process with some central configurations. Later I intent to expand this to a scripted installation. The final goal is to be able to provide a complete AD forrest automatic.
Clone Windows Server
I have a stand-alone Windows Server that I clone in the current state where it is shut down (cold) and the clone is a full clone opposite to a linked clone. The installation and configuration is described in the blog post "Sandbox Windows Server in VMware Workstation".Generalize Windows with sysprep
Microsoft Docs: "Sysprep (System Preparation) Overview"Prepare virtual network
- Custom network (VMnet13, host-only)
- DHCP disabled
- Subnet IP: 192.168.42.0
- Subnet mask: 255.255.255.0
Prepare server
Network profile:- IP : 192.168.42.42
- Subnet : 255.255.255.0
- Preferred DNS : 192.168.42.42 (this host)
- Alternate DNS : 192.168.42.1 (the vmnet)
- Default gateway: None (host-only)
- Rename computer, e.g. "DC00".
- Start PowerShell as administrator.
Rename-Computer -NewName 'DC00' -Restart
- Danish keyboard - as a Dane I usually end up with a Danish keyboard.
- Windows location: UK to set for UTC time. This is to avoid issues with daylight savings and other local tricks.
- English UK ISO-8601'ish date time format.
- Windows SmartScreen enabled.
- Set password on Administrator user and rename user, e.g. "Ragnar". Password never expires.
- Personal administrator user, e.g. "SuperNiels". Password never expires.
- vmxnet3 Ethernet Adapter:
- Do not allow computer to turn off device to save power.
- See the post "vmxnet3 network adapter" about vmxnet paravirtualized network adapter.
- Remove Ethernet0 after vmxnet3 configuration.
- Rename adapter, e.g. to "Ethernet42".
- Remove old network adapter. Show hidden devices in Device Manager and remove Intel Gigabit Network Connection.
- Static network definition; IP and DNS. This should be done after changing the ethernet adapter as the configuration is assigned the adapter.
- Print Spooler service stopped and disabled
- Start PowerShell as administrator.
Stop-Service -Name 'spooler'
Set-Service -Name 'spooler' -StartupType 'Disabled' - Activate Windows Server. This can be done offline as described in the post "Activate Windows Server offline". Or you can temporary change virtual network to a network with NAT to the internet.
Configure Domain Controller
Domain: sandbox.lan- Add Windows Server roles: Active Directory Domain Services (AD DS) and DNS Server. Both with all features and tools.
- Promote server to Domain Controller (dcpromo) in a new forrest.
- Specify domain controller capabilities; DNS server and Global Catalog on the domain "sandbox.lan".
- Enter password for DSRM.
- Do not delegate DNS.
- Accept the NetBIOS name "SANDBOX".
- Accept the default folders. If you are installing a DC in Production this is a configuration to consider.
Import-Module ADDSDeployment
Install-ADDSForest -CreateDnsDelegation:$false -DatabasePath "C:\Windows\NTDS" -DomainMode "WinThreshold" -DomainName "sandbox.lan" -DomainNetbiosName "SANDBOX" -ForestMode "WinThreshold" -InstallDns:$true -LogPath "C:\Windows\NTDS" -NoRebootOnCompletion:$false -SysvolPath "C:\Windows\SYSVOL" -Force:$true
Review the validation and start installation of AD DS.
When the installation of AD DS in complete you will be logged of and the server will be restarted.
Verify Domain Controller
The Server Manager now also shows the items "AD DS" and "DNS" in the menu to the left.I the System window full computer name is now "DC00.sandbox.lan". Also the workgroup field is now a domain field where the domain name "sandbox.lan" is shown.
Patch Windows Server offline
- Get latest cumulative from Microsoft Update
- Copy installation set to the virtual server
- Run installation on the virtual server as administrator
History
2023-09-21 Creation of VM migrated to SQLAdmin blog post.
2018-12-28 Post migrated to SQLAdmin blog.2018-04-30 Post released on AzureAdmin blog.