That’s actually pretty simple, you just need to run this utility:
D: is your CD/DVD drive with Windows 2008 R2. In our case it was a virtual drive mounted in Hyper-V, but I think it does not really matter. I did preparation for both forest and domain, because in our situation they are identical. Yours might be different. What is important is that this procedure should be run from the infrastructure owner. If you are not sure about which DC holds infrastructure owner role, you can get that information by typing the following in CMD:
netdom query fsmo
There is another, more popular method on the network, which involves
NTDSUTIL. Don’t use it, as it needs too many command lines and yields the same results.