In Windows Server 2012 Microsoft introduced a new feature that allows us to clone domain controllers. This helps us sysadmins to quickly restore a domain controller in an event of failures (when we have one left) and it also helps us to deploy to test environments when needed.
Before Server 2012 you were able to clone domain controllers, but you were not able to deploy to the same domain without running sysprep. Running sysprep removes all security information meaning you would need to promote the domain controller manually. Not anymore! Now when you clone a Domain Controller it will do the sysprep and the promotion process automatically.
1. Log on to the Domain Controller you want to Clone using either a Domain Admin or Enterprise Admin account.
2. Go to Server Manager > Tools > Active Directory Users and Computers
3. Then go to the Domain Controllers OU. Select the DC we are cloning and right click and select Properties.
4. Go to the member of tab and click Add.
5. Then add the security group Cloneable Domain Controllers and click OK.
6. Open Powershell with admin rights and then type the following command. This will check the server to see if there are any programs that are not compatible with the cloning process.
7. If anything comes up in the list, make sure you remove them before the cloning process.
8. After you have removed any non-compatible programs type the following command.
New-ADDCCloneConfigFile –Static -IPv4Address “192.168.2.202” -IPv4DNSResolver “192.168.2.201” -IPv4SubnetMask “255.255.255.0” –CloneComputerName “PIXEL-DC02” -IPv4DefaultGateway “192.168.2.1” -SiteName “Default-First-Site-Name”
In the above code I specify the ip address information it (the clone server) will hold. Also the computer name and site name.
9. Once this has finished, close the powershell window and shutdown the server. (If you only have ONE DC, do this out of core hours.)
10. Open Hyper-V Manager and right click the DC that you are cloning and click Export. Select the path to save the exported VM to.
11. Once the export has completed, you can start the DC again.
12. Now we are ready to import the newly cloned DC. To do this in Hyper-V manager go to Action > Import Virtual Machine.
13. The import wizard will open and you can click Next to continue.
14. Specify the folder path to the exported DC and click Next.
15. Select the VM and then click Next.
16. Select Copy the virtual machine (create a new unique ID) and click Next.
17. Now you will get asked where you want to store the new VM. This is all based on your requirement, but once you have set what you want click Next.
18. Now set where you would like the storage folder to be. This is per your requirements again, but once you have set click Next.
19. Click Finish on the summary page. The import process will now start.
20. Once the import is complete. You can start the new DC.
21. The new DC will restart a few times as it goes through its automated process.
22. Once this has completed log in to the server as a Domain Admin. You should now see the new DC in the Domain Controllers OU and also under Sites and Services.