Upgrading Domain Controllers to a newer version is a step that most of the administrators will have to do it. In my example I did all the upgrade in a test environment, upgrading Domain Controllers from Windows Server 2008 R2 to Windows Server 2012.
The new wizard from Windows Server 2012 can detect when is needed to automatically run the ADPREP(/forestprep or /domainprep), but if you prefer you can still run the command manually.
After the process of preparing the forest is finished, we will have to install and configure AD DS on the Windows Server 2012. We will do this with Powerhsell, running the command Add-WindowsFeature –name ad-domain-services –IncludeManagementTools and Install-ADDSDomainController to configure the server as Domain Controller.
The first step after finishing the configuration of the new Domain Controller is to move the FSMO roles from the Windows Server 2008 R2 Domain Controller. First we have to move the Schema master Role through Active Directory Schema Master, but before that we have to register Schmmgmt.dll with regsrv32 schmmgmt.dll command.
After this we’ll have to right click Active Directory Schema and choose Operation Masters to move the role on the new server.
Same step (change domain controller first and after that moving the role) has to be done for all the other roles, the difference is that Domain Naming Master is moved with Active Directory Domains and Trusts console and ID Master, PDC Emulator, Infrastructure Master with Active Directory Users and Computers console.
In the end to make sure that all the roles are on the new Domain Controller we run the netdom query fsmo command.